pub struct FieldSchema<Id = SchemaHash> {
pub name: String,
pub type_ref: TypeRef<Id>,
pub required: bool,
}Expand description
Describes a single field in a struct or struct variant.
Fields§
§name: String§type_ref: TypeRef<Id>§required: boolImplementations§
Source§impl<Id> FieldSchema<Id>
impl<Id> FieldSchema<Id>
Sourcepub fn for_each_type_ref(&self, f: &mut impl FnMut(&TypeRef<Id>))
pub fn for_each_type_ref(&self, f: &mut impl FnMut(&TypeRef<Id>))
Visit the TypeRef in this field.
Sourcepub fn try_map_type_ref<OtherId, E>(
self,
f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>,
) -> Result<FieldSchema<OtherId>, E>
pub fn try_map_type_ref<OtherId, E>( self, f: &mut impl FnMut(TypeRef<Id>) -> Result<TypeRef<OtherId>, E>, ) -> Result<FieldSchema<OtherId>, E>
Transform the TypeRef in this field.
Trait Implementations§
Source§impl<Id: Clone> Clone for FieldSchema<Id>
impl<Id: Clone> Clone for FieldSchema<Id>
Source§fn clone(&self) -> FieldSchema<Id>
fn clone(&self) -> FieldSchema<Id>
Returns a duplicate 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 moreSource§impl<Id: Debug> Debug for FieldSchema<Id>
impl<Id: Debug> Debug for FieldSchema<Id>
Auto Trait Implementations§
impl<Id> Freeze for FieldSchema<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for FieldSchema<Id>where
Id: RefUnwindSafe,
impl<Id> Send for FieldSchema<Id>where
Id: Send,
impl<Id> Sync for FieldSchema<Id>where
Id: Sync,
impl<Id> Unpin for FieldSchema<Id>where
Id: Unpin,
impl<Id> UnsafeUnpin for FieldSchema<Id>where
Id: UnsafeUnpin,
impl<Id> UnwindSafe for FieldSchema<Id>where
Id: UnwindSafe,
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
Mutably borrows from an owned value. Read more