pub trait OptFields:
Sized
+ Default
+ Clone {
// Required methods
fn fields(&self) -> &[OptElem];
fn parse(input: Split<'_, &str>) -> Self;
fn new() -> Self;
}
Expand description
Trait for OptFields
Required Methods§
Sourcefn fields(&self) -> &[OptElem]
fn fields(&self) -> &[OptElem]
Return a slice over all optional fields. NB: This may be replaced by an iterator or something else in the future
Sourcefn parse(input: Split<'_, &str>) -> Self
fn parse(input: Split<'_, &str>) -> Self
Given an iterator over a split, each expected to hold one
optional field (in the
fn new() -> Self
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.
Implementations on Foreign Types§
Source§impl OptFields for ()
This implementation is useful for performance if we don’t actually
need any optional fields. () takes up zero space, and all
methods are no-ops.
impl OptFields for ()
This implementation is useful for performance if we don’t actually need any optional fields. () takes up zero space, and all methods are no-ops.