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 Session
pub fn create<K: TryInto<Ustr>>(&mut self, name: K) -> &mut Session
Create a new session, and borrow it mutably so it can be modified.
sourcepub fn get<K: TryInto<Ustr>>(&self, name: K) -> Option<&Session>
pub fn get<K: TryInto<Ustr>>(&self, name: K) -> Option<&Session>
Borrow a session from the sessions list.
sourcepub fn get_mut<K: TryInto<Ustr>>(&mut self, name: K) -> Option<&mut Session>
pub fn get_mut<K: TryInto<Ustr>>(&mut self, name: K) -> Option<&mut Session>
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 Freeze for Sessions
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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
.