pub struct SaveWorld<F = With<Save>>where
F: QueryFilter,{
pub entities: EntityFilter,
pub resources: SceneFilter,
pub components: SceneFilter,
pub mapper: SceneMapper,
pub output: SaveOutput,
/* private fields */
}Fields§
§entities: EntityFilterA filter for selecting which entities should be saved.
By default, all entities are selected.
resources: SceneFilterA filter for selecting which resources should be saved.
By default, no resources are selected. Most Bevy resources are not safely serializable.
components: SceneFilterA filter for selecting which components should be saved.
By default, all serializable components are selected.
mapper: SceneMapperA mapper for transforming components during the save process.
See MapComponent for more information.
output: SaveOutputOutput of the saved world.
Implementations§
Source§impl<F> SaveWorld<F>where
F: QueryFilter,
impl<F> SaveWorld<F>where
F: QueryFilter,
Sourcepub fn new(output: SaveOutput) -> SaveWorld<F>
pub fn new(output: SaveOutput) -> SaveWorld<F>
Creates a new SaveWorld event with the given SaveOutput.
Sourcepub fn into_file(path: impl Into<PathBuf>) -> SaveWorld<F>
pub fn into_file(path: impl Into<PathBuf>) -> SaveWorld<F>
Creates a new SaveWorld event which saves entities matching the
given QueryFilter into a file at the given path.
Sourcepub fn into_stream(stream: impl SaveStream) -> SaveWorld<F>
pub fn into_stream(stream: impl SaveStream) -> SaveWorld<F>
Creates a new SaveWorld event which saves entities matching the
given QueryFilter into a Write stream.
Sourcepub fn include_resource<R>(self) -> SaveWorld<F>where
R: Resource,
pub fn include_resource<R>(self) -> SaveWorld<F>where
R: Resource,
Includes the given Resource in the save data.
Sourcepub fn include_resource_by_id(self, type_id: TypeId) -> SaveWorld<F>
pub fn include_resource_by_id(self, type_id: TypeId) -> SaveWorld<F>
Sourcepub fn exclude_component<T>(self) -> SaveWorld<F>where
T: Component,
pub fn exclude_component<T>(self) -> SaveWorld<F>where
T: Component,
Excludes the given Component from the save data.
Sourcepub fn exclude_component_by_id(self, type_id: TypeId) -> SaveWorld<F>
pub fn exclude_component_by_id(self, type_id: TypeId) -> SaveWorld<F>
Sourcepub fn map_component<T>(self, m: impl MapComponent<T>) -> SaveWorld<F>where
T: Component,
pub fn map_component<T>(self, m: impl MapComponent<T>) -> SaveWorld<F>where
T: Component,
Maps the given Component into another using a component mapper before saving.
Source§impl SaveWorld
impl SaveWorld
Sourcepub fn default_into_file(path: impl Into<PathBuf>) -> SaveWorld
pub fn default_into_file(path: impl Into<PathBuf>) -> SaveWorld
Sourcepub fn default_into_stream(stream: impl SaveStream) -> SaveWorld
pub fn default_into_stream(stream: impl SaveStream) -> SaveWorld
Trait Implementations§
Source§impl<F> SaveEvent for SaveWorld<F>where
F: QueryFilter + Static,
impl<F> SaveEvent for SaveWorld<F>where
F: QueryFilter + Static,
Source§type SaveFilter = F
type SaveFilter = F
QueryFilter used as the initial filter for selecting saved entities.Source§fn filter_entity(&self, entity: EntityRef<'_>) -> bool
fn filter_entity(&self, entity: EntityRef<'_>) -> bool
true if the given Entity should be saved.Source§fn before_serialize(&mut self, world: &mut World, entities: &[Entity])
fn before_serialize(&mut self, world: &mut World, entities: &[Entity])
Source§fn after_save(&mut self, world: &mut World, result: &Result<Saved, SaveError>)
fn after_save(&mut self, world: &mut World, result: &Result<Saved, SaveError>)
Source§fn component_filter(&mut self) -> SceneFilter
fn component_filter(&mut self) -> SceneFilter
SceneFilter for selecting which components should be saved.Source§fn resource_filter(&mut self) -> SceneFilter
fn resource_filter(&mut self) -> SceneFilter
SceneFilter for selecting which resources should be saved.Source§fn output(&mut self) -> SaveOutput
fn output(&mut self) -> SaveOutput
SaveOutput of the save process.Source§fn before_save(&mut self, _world: &mut World)
fn before_save(&mut self, _world: &mut World)
impl<F> SingleEvent for SaveWorld<F>where
F: QueryFilter + Static,
Auto Trait Implementations§
impl<F> Freeze for SaveWorld<F>
impl<F = With<Save>> !RefUnwindSafe for SaveWorld<F>
impl<F> Send for SaveWorld<F>where
F: Send,
impl<F> Sync for SaveWorld<F>where
F: Sync,
impl<F> Unpin for SaveWorld<F>where
F: Unpin,
impl<F = With<Save>> !UnwindSafe for SaveWorld<F>
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
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>
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>
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)
&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)
&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> ⓘ
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> ⓘ
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 more