pub struct Sessions { /* private fields */ }
Expand description
Container for multiple game sessions.
Each session shares the same Entities
.
Implementations§
source§impl Sessions
impl Sessions
sourcepub fn create<K: TryInto<Ustr>>(&mut self, name: K) -> &mut Sessionwhere
<K as TryInto<Ustr>>::Error: Debug,
pub fn create<K: TryInto<Ustr>>(&mut self, name: K) -> &mut Sessionwhere <K as TryInto<Ustr>>::Error: Debug,
Create a new session, and borrow it mutably so it can be modified.
sourcepub fn delete<K: TryInto<Ustr>>(&mut self, name: K)where
<K as TryInto<Ustr>>::Error: Debug,
pub fn delete<K: TryInto<Ustr>>(&mut self, name: K)where <K as TryInto<Ustr>>::Error: Debug,
Delete a session.
sourcepub fn get<K: TryInto<Ustr>>(&self, name: K) -> Option<&Session>where
<K as TryInto<Ustr>>::Error: Debug,
pub fn get<K: TryInto<Ustr>>(&self, name: K) -> Option<&Session>where <K as TryInto<Ustr>>::Error: Debug,
Borrow a session from the sessions list.
sourcepub fn get_mut<K: TryInto<Ustr>>(&mut self, name: K) -> Option<&mut Session>where
<K as TryInto<Ustr>>::Error: Debug,
pub fn get_mut<K: TryInto<Ustr>>(&mut self, name: K) -> Option<&mut Session>where <K as TryInto<Ustr>>::Error: Debug,
Borrow a session from the sessions list.
sourcepub fn add_command(&mut self, command: Box<SessionCommand>)
pub fn add_command(&mut self, command: Box<SessionCommand>)
Add a SessionCommand
to queue.
Trait Implementations§
source§impl HasSchema for Sessions
impl HasSchema for Sessions
§fn register_schema()
fn register_schema()
Register this schema with the global schema registry. Read more
§fn cast<T>(this: &Self) -> &Twhere
T: HasSchema,
fn cast<T>(this: &Self) -> &Twhere T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
§fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where
T: HasSchema,
fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
§fn cast_mut<T>(this: &mut Self) -> &mut Twhere
T: HasSchema,
fn cast_mut<T>(this: &mut Self) -> &mut Twhere T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
§fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where
T: HasSchema,
fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
§fn as_schema_ref(&self) -> SchemaRef<'_>where
Self: Sized,
fn as_schema_ref(&self) -> SchemaRef<'_>where Self: Sized,
Converts a reference of
T
to a SchemaRef
§fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where
Self: Sized,
fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where Self: Sized,
Converts a reference of
T
to a SchemaRefMut
Auto Trait Implementations§
impl !RefUnwindSafe for Sessions
impl Send for Sessions
impl Sync for Sessions
impl Unpin for Sessions
impl !UnwindSafe for Sessions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Creates
Self
using data from the given World
.