Struct bevy_reflect::serde::SerializationData
source · pub struct SerializationData { /* private fields */ }
Expand description
Contains data relevant to the automatic reflect powered serialization of a type
Implementations§
source§impl SerializationData
impl SerializationData
sourcepub fn new<I: Iterator<Item = usize>>(ignored_iter: I) -> Self
pub fn new<I: Iterator<Item = usize>>(ignored_iter: I) -> Self
Creates a new SerializationData
instance given:
ignored_iter
: the iterator of member indices to be ignored during serialization. Indices are assigned only to reflected members, those which are not reflected are skipped.
sourcepub fn is_ignored_field(&self, index: usize) -> bool
pub fn is_ignored_field(&self, index: usize) -> bool
Returns true if the given index corresponds to a field meant to be ignored in serialization.
Indices start from 0 and ignored fields are skipped.
Example
ⓘ
for (idx, field) in my_struct.iter_fields().enumerate(){
if serialization_data.is_ignored_field(idx){
// serialize ...
}
}
Trait Implementations§
source§impl Clone for SerializationData
impl Clone for SerializationData
source§fn clone(&self) -> SerializationData
fn clone(&self) -> SerializationData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for SerializationData
impl Send for SerializationData
impl Sync for SerializationData
impl Unpin for SerializationData
impl UnwindSafe for SerializationData
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more