pub trait ParseItem: Sized {
// Required method
fn from_str(item: &str) -> Result<Self, ParseStringError>;
// Provided methods
fn from_entry(entry: Entry) -> Result<Self, ParseEntryError> { ... }
fn from_item(item: Item<'_>) -> Result<Self, ParseItemError> { ... }
}
Expand description
Parsable types.
Required Methods§
Sourcefn from_str(item: &str) -> Result<Self, ParseStringError>
fn from_str(item: &str) -> Result<Self, ParseStringError>
Try to cast the string into a concrete type
Provided Methods§
Sourcefn from_entry(entry: Entry) -> Result<Self, ParseEntryError>
fn from_entry(entry: Entry) -> Result<Self, ParseEntryError>
Try to cast the entry into a concrete type
Sourcefn from_item(item: Item<'_>) -> Result<Self, ParseItemError>
fn from_item(item: Item<'_>) -> Result<Self, ParseItemError>
Try to cast the item into a concrete 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.