Enum bones_lib::ecs::prelude::SchemaRefMutAccess
pub enum SchemaRefMutAccess<'a> {
Struct(StructRefMutAccess<'a>),
Vec(SchemaVecMutAccess<'a>),
Enum(EnumRefMutAccess<'a>),
Map(SchemaMapMutAccess<'a>),
Primitive(PrimitiveRefMut<'a>),
}
Expand description
Access a schema
Variants§
Struct(StructRefMutAccess<'a>)
Access a struct.
Vec(SchemaVecMutAccess<'a>)
Access a vec.
Enum(EnumRefMutAccess<'a>)
Access an enum.
Map(SchemaMapMutAccess<'a>)
Access a map.
Primitive(PrimitiveRefMut<'a>)
Access a struct.
Implementations§
§impl<'pointer> SchemaRefMutAccess<'pointer>
impl<'pointer> SchemaRefMutAccess<'pointer>
pub fn new(value: SchemaRefMut<'_>) -> SchemaRefMutAccess<'_>
pub fn new(value: SchemaRefMut<'_>) -> SchemaRefMutAccess<'_>
Create a new SchemaRefAccess
for the given SchemaRef
.
This will create a new independent SchemaRefAccess
that may be used even after
the original SchemaRef
is dropped ( but not beyond the safe lifetime of the
original schema ref ).
pub fn new_borrowed<'borrow>(
value: &'borrow mut SchemaRefMut<'_>,
) -> SchemaRefMutAccess<'borrow>
pub fn new_borrowed<'borrow>( value: &'borrow mut SchemaRefMut<'_>, ) -> SchemaRefMutAccess<'borrow>
Create a new SchemaRefAccess
for the given SchemaRef
that borrows the original
SchemaRef
.
This is subtly different from SchemaRefAccess::new()
because it requires that it hold
a borrow to the original schema ref it was created from. This is specifically useful becuse
it lets you create a SchemaRefAccess
from a refeence to a schema ref, which is required
when accessing a schema ref that is behind an atomic resource borrow, for example.
pub fn into_schema_ref_mut(self) -> SchemaRefMut<'pointer>
pub fn into_schema_ref_mut(self) -> SchemaRefMut<'pointer>
Convert this to a SchemaRefMut
.
pub fn field<'a, I>(
self,
field_idx: I,
) -> Result<SchemaRefMutAccess<'pointer>, SchemaRefMutAccess<'pointer>>
pub fn field<'a, I>( self, field_idx: I, ) -> Result<SchemaRefMutAccess<'pointer>, SchemaRefMutAccess<'pointer>>
Get field with the given index.
pub fn field_path<'a, I>(self, path: I) -> Option<SchemaRefMutAccess<'pointer>>where
I: IntoIterator<Item = FieldIdx<'a>>,
pub fn field_path<'a, I>(self, path: I) -> Option<SchemaRefMutAccess<'pointer>>where
I: IntoIterator<Item = FieldIdx<'a>>,
Get the field pointed to by the given path.
pub fn as_ref(&self) -> SchemaRefAccess<'_>
pub fn as_ref(&self) -> SchemaRefAccess<'_>
Borrow this SchemaRefMutAccess
as a SchemaRefAccess
.