pub struct LoadWorld<U = Or<(With<Save>, With<Unload>)>>where
U: QueryFilter,{
pub input: LoadInput,
pub mapper: SceneMapper,
/* private fields */
}Expand description
A generic LoadEvent which loads the world from a file or stream.
Fields§
§input: LoadInputThe input data used to load the world.
mapper: SceneMapperA SceneMapper used to map components after the load process.
Implementations§
Source§impl<U> LoadWorld<U>where
U: QueryFilter,
impl<U> LoadWorld<U>where
U: QueryFilter,
Sourcepub fn new(input: LoadInput, mapper: SceneMapper) -> LoadWorld<U>
pub fn new(input: LoadInput, mapper: SceneMapper) -> LoadWorld<U>
Creates a new LoadWorld with the given input and mapper.
Sourcepub fn from_file(path: impl Into<PathBuf>) -> LoadWorld<U>
pub fn from_file(path: impl Into<PathBuf>) -> LoadWorld<U>
Creates a new LoadWorld which unloads entities matching the given
QueryFilter before the file at given path.
Sourcepub fn from_stream(stream: impl LoadStream) -> LoadWorld<U>
pub fn from_stream(stream: impl LoadStream) -> LoadWorld<U>
Creates a new LoadWorld which unloads entities matching the given
QueryFilter before loading from the given Read stream.
Sourcepub fn map_component<T>(self, m: impl MapComponent<T>) -> LoadWorld<U>where
T: Component,
pub fn map_component<T>(self, m: impl MapComponent<T>) -> LoadWorld<U>where
T: Component,
Maps the given Component into another using a component mapper after loading.
Source§impl LoadWorld
impl LoadWorld
Sourcepub fn default_from_file(path: impl Into<PathBuf>) -> LoadWorld
pub fn default_from_file(path: impl Into<PathBuf>) -> LoadWorld
Sourcepub fn default_from_stream(stream: impl LoadStream) -> LoadWorld
pub fn default_from_stream(stream: impl LoadStream) -> LoadWorld
Trait Implementations§
Source§impl<U> LoadEvent for LoadWorld<U>where
U: QueryFilter + Static,
impl<U> LoadEvent for LoadWorld<U>where
U: QueryFilter + Static,
Source§type UnloadFilter = U
type UnloadFilter = U
A
QueryFilter used as the initial filter for selecting entities to unload.Source§fn before_load(&mut self, world: &mut World)
fn before_load(&mut self, world: &mut World)
Called once before the load process starts. Read more
impl<U> SingleEvent for LoadWorld<U>where
U: QueryFilter + Static,
Auto Trait Implementations§
impl<U> Freeze for LoadWorld<U>
impl<U = Or<(With<Save>, With<Unload>)>> !RefUnwindSafe for LoadWorld<U>
impl<U> Send for LoadWorld<U>where
U: Send,
impl<U> Sync for LoadWorld<U>where
U: Sync,
impl<U> Unpin for LoadWorld<U>where
U: Unpin,
impl<U = Or<(With<Save>, With<Unload>)>> !UnwindSafe for LoadWorld<U>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.