pub struct OuterFrom {
pub ident: Option<Ident>,
pub attrs: Option<AttrsField>,
pub container: Core,
pub attr_names: PathList,
pub forward_attrs: Option<ForwardAttrsFilter>,
pub from_ident: bool,
}
Expand description
Reusable base for FromDeriveInput
, FromVariant
, FromField
, and other top-level
From*
traits.
Fields§
§ident: Option<Ident>
The field on the target struct which should receive the type identifier, if any.
attrs: Option<AttrsField>
The field on the target struct which should receive the type attributes, if any.
container: Core
§attr_names: PathList
The attribute names that should be searched.
forward_attrs: Option<ForwardAttrsFilter>
The attribute names that should be forwarded. The presence of the word with no additional filtering will cause all attributes to be cloned and exposed to the struct after parsing.
from_ident: bool
Whether or not the container can be made through conversion from the type Ident
.
Implementations§
source§impl OuterFrom
impl OuterFrom
pub fn start(di: &DeriveInput) -> Result<Self>
pub fn as_forward_attrs(&self) -> ForwardAttrs<'_>
Trait Implementations§
source§impl ParseAttribute for OuterFrom
impl ParseAttribute for OuterFrom
source§impl ParseData for OuterFrom
impl ParseData for OuterFrom
source§fn parse_field(&mut self, field: &Field) -> Result<()>
fn parse_field(&mut self, field: &Field) -> Result<()>
Apply the next found struct field to the object, returning an error
if parsing goes wrong.
source§fn validate_body(&self, errors: &mut Accumulator)
fn validate_body(&self, errors: &mut Accumulator)
Perform validation checks that require data from more than one field or variant.
The default implementation does no validations.
Implementors can override this method as appropriate for their use-case.
fn parse_body(self, body: &Data) -> Result<Self>
Auto Trait Implementations§
impl Freeze for OuterFrom
impl RefUnwindSafe for OuterFrom
impl !Send for OuterFrom
impl !Sync for OuterFrom
impl Unpin for OuterFrom
impl UnwindSafe for OuterFrom
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)