Skip to main content

FromAttribute

Trait FromAttribute 

Source
pub trait FromAttribute: Sized {
    // Required method
    fn parse(group: &Group) -> Result<Option<Self>>;
}
Expand description

Helper trait for AttributeAccess methods.

This can be implemented on your own type to make parsing easier.

Some functions that can make your life easier:

Required Methods§

Source

fn parse(group: &Group) -> Result<Option<Self>>

Try to parse the given group into your own type. Return Ok(None) if the parsing failed or if the attribute was not this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§