Enum bones_lib::prelude::bones_schema::prelude::SchemaRefAccess
pub enum SchemaRefAccess<'a> {
Struct(StructRefAccess<'a>),
Vec(SchemaVecAccess<'a>),
Enum(EnumRefAccess<'a>),
Map(SchemaMapAccess<'a>),
Primitive(PrimitiveRef<'a>),
}
Expand description
Helper for accessing the inner data of a schema ref at runtime.
Variants§
Struct(StructRefAccess<'a>)
Access a struct.
Vec(SchemaVecAccess<'a>)
Access a vec.
Enum(EnumRefAccess<'a>)
Access an enum.
Map(SchemaMapAccess<'a>)
Access a map.
Primitive(PrimitiveRef<'a>)
Access a struct.
Implementations§
§impl<'ptr> SchemaRefAccess<'ptr>
impl<'ptr> SchemaRefAccess<'ptr>
pub fn new(value: SchemaRef<'_>) -> SchemaRefAccess<'_>
pub fn new(value: SchemaRef<'_>) -> SchemaRefAccess<'_>
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 SchemaRef<'_>,
) -> SchemaRefAccess<'borrow>
pub fn new_borrowed<'borrow>( value: &'borrow SchemaRef<'_>, ) -> SchemaRefAccess<'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 field<'a, I>(self, field_idx: I) -> Option<SchemaRefAccess<'ptr>>
pub fn field<'a, I>(self, field_idx: I) -> Option<SchemaRefAccess<'ptr>>
Get field with the given index.
pub fn field_path<'a, I>(self, path: I) -> Option<SchemaRefAccess<'ptr>>where
I: IntoIterator<Item = FieldIdx<'a>>,
pub fn field_path<'a, I>(self, path: I) -> Option<SchemaRefAccess<'ptr>>where
I: IntoIterator<Item = FieldIdx<'a>>,
Get the field pointed to by the given path.
pub fn into_schema_ref(self) -> SchemaRef<'ptr>
pub fn into_schema_ref(self) -> SchemaRef<'ptr>
Borrow this SchemaRefMutAccess
as a SchemaRefAccess
.
Trait Implementations§
§impl<'a> Clone for SchemaRefAccess<'a>
impl<'a> Clone for SchemaRefAccess<'a>
§fn clone(&self) -> SchemaRefAccess<'a>
fn clone(&self) -> SchemaRefAccess<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for SchemaRefAccess<'_>
impl Debug for SchemaRefAccess<'_>
impl<'a> Copy for SchemaRefAccess<'a>
Auto Trait Implementations§
impl<'a> Freeze for SchemaRefAccess<'a>
impl<'a> !RefUnwindSafe for SchemaRefAccess<'a>
impl<'a> !Send for SchemaRefAccess<'a>
impl<'a> !Sync for SchemaRefAccess<'a>
impl<'a> Unpin for SchemaRefAccess<'a>
impl<'a> !UnwindSafe for SchemaRefAccess<'a>
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> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)