pub struct LoadWorld<U: QueryFilter = DefaultUnloadFilter> {
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: QueryFilter> LoadWorld<U>
impl<U: QueryFilter> LoadWorld<U>
Sourcepub fn new(input: LoadInput, mapper: SceneMapper) -> Self
pub fn new(input: LoadInput, mapper: SceneMapper) -> Self
Creates a new LoadWorld with the given input and mapper.
Sourcepub fn from_file(path: impl Into<PathBuf>) -> Self
pub fn from_file(path: impl Into<PathBuf>) -> Self
Creates a new LoadWorld which unloads entities matching the given
QueryFilter before the file at given path.
Sourcepub fn from_stream(stream: impl LoadStream) -> Self
pub fn from_stream(stream: impl LoadStream) -> Self
Creates a new LoadWorld which unloads entities matching the given
QueryFilter before loading from the given Read stream.
Sourcepub fn map_component<T: Component>(self, m: impl MapComponent<T>) -> Self
pub fn map_component<T: Component>(self, m: impl MapComponent<T>) -> Self
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>) -> Self
pub fn default_from_file(path: impl Into<PathBuf>) -> Self
Sourcepub fn default_from_stream(stream: impl LoadStream) -> Self
pub fn default_from_stream(stream: impl LoadStream) -> Self
Trait Implementations§
Source§impl<U> LoadEvent for LoadWorld<U>where
U: Static + QueryFilter,
impl<U> LoadEvent for LoadWorld<U>where
U: Static + QueryFilter,
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
Source§fn after_load(&mut self, world: &mut World, result: &LoadResult)
fn after_load(&mut self, world: &mut World, result: &LoadResult)
Called for all entities after they have been loaded. Read more
impl<U> SingleEvent for LoadWorld<U>where
U: Static + QueryFilter,
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.