pub struct ResourceDesc {Show 15 fields
pub fields: &'static [FieldDesc],
pub field: for<'a> fn(&'a dyn Any, usize) -> Option<&'a dyn Any>,
pub field_mut: for<'a> fn(&'a mut dyn Any, usize) -> Option<&'a mut dyn Any>,
pub build: fn(&mut dyn FieldSource, &mut dyn Any) -> Result<(), ModelError>,
pub empty: fn() -> Box<dyn Any>,
pub unwrap: fn(&dyn Any) -> Option<&dyn Any>,
pub replace: fn(&mut dyn Any, &mut dyn Any) -> Result<(), ModelError>,
pub own_check: Option<OwnCheck>,
pub label: Option<usize>,
pub label_parts: &'static [usize],
pub label_with: Option<fn(&dyn Any) -> Option<String>>,
pub name: fn() -> &'static str,
pub shape: Shape,
pub checks: bool,
pub has_ops: bool,
}Expand description
A record type as #[derive(Model)] describes it. See the module
docs.
Fields§
§fields: &'static [FieldDesc]Its stored fields, in declaration order.
field: for<'a> fn(&'a dyn Any, usize) -> Option<&'a dyn Any>The field at a position of a record.
field_mut: for<'a> fn(&'a mut dyn Any, usize) -> Option<&'a mut dyn Any>The same, mutably.
build: fn(&mut dyn FieldSource, &mut dyn Any) -> Result<(), ModelError>A record from its fields, in order, put into an Option of it.
empty: fn() -> Box<dyn Any>An empty Option of the record, for Self::build to fill.
unwrap: fn(&dyn Any) -> Option<&dyn Any>The record in a filled Option of it.
replace: fn(&mut dyn Any, &mut dyn Any) -> Result<(), ModelError>Move the record out of a filled Option (the second) over a record
(the first).
own_check: Option<OwnCheck>Its own invariant.
label: Option<usize>The position of its #[model(label)] field.
label_parts: &'static [usize]The positions of the fields its label joins (#[model(label = "..")]).
label_with: Option<fn(&dyn Any) -> Option<String>>What names it, where its name is not a field’s text as stored
(#[model(label = path)]).
name: fn() -> &'static strIts type’s name: what a deferred check is known by.
shape: ShapeIts stored shape.
checks: boolIts Model::CHECKS.
has_ops: boolIts Model::OPS.
Auto Trait Implementations§
impl Forget for ResourceDesc
impl Freeze for ResourceDesc
impl Move for ResourceDesc
impl RefUnwindSafe for ResourceDesc
impl Send for ResourceDesc
impl Sync for ResourceDesc
impl Unpin for ResourceDesc
impl UnsafeUnpin for ResourceDesc
impl UnwindSafe for ResourceDesc
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more