Enum bones_schema::ptr::SchemaRefMutAccess
source · 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§
source§impl<'pointer> SchemaRefMutAccess<'pointer>
impl<'pointer> SchemaRefMutAccess<'pointer>
sourcepub 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 ).
sourcepub 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.
sourcepub fn into_schema_ref_mut(self) -> SchemaRefMut<'pointer>
pub fn into_schema_ref_mut(self) -> SchemaRefMut<'pointer>
Convert this to a SchemaRefMut
.
sourcepub fn field<'a, I: Into<FieldIdx<'a>>>(
self,
field_idx: I,
) -> Result<Self, Self>
pub fn field<'a, I: Into<FieldIdx<'a>>>( self, field_idx: I, ) -> Result<Self, Self>
Get field with the given index.
sourcepub fn field_path<'a, I: IntoIterator<Item = FieldIdx<'a>>>(
self,
path: I,
) -> Option<Self>
pub fn field_path<'a, I: IntoIterator<Item = FieldIdx<'a>>>( self, path: I, ) -> Option<Self>
Get the field pointed to by the given path.
sourcepub fn as_ref(&self) -> SchemaRefAccess<'_>
pub fn as_ref(&self) -> SchemaRefAccess<'_>
Borrow this SchemaRefMutAccess
as a SchemaRefAccess
.