Skip to main content

ResourceDesc

Struct ResourceDesc 

Source
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 str

Its type’s name: what a deferred check is known by.

§shape: Shape

Its stored shape.

§checks: bool§has_ops: bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more