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.
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 SchemaRefMutAuto 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
source§impl<T> FromWorld for Twhere
    T: Default,
 
impl<T> FromWorld for Twhere
    T: Default,
source§fn from_world(_world: &World) -> T
 
fn from_world(_world: &World) -> T
Creates 
Self using data from the given World.