pub trait CommandCustomHeader {
// Required method
fn to_map(&self) -> Option<HashMap<String, String>>;
// Provided method
fn check_fields(&self) -> Result<(), Error> { ... }
}Required Methods§
sourcefn to_map(&self) -> Option<HashMap<String, String>>
fn to_map(&self) -> Option<HashMap<String, String>>
Converts the implementing type to a map.
Returns an Option that contains a HashMap of string keys and string values,
representing the implementing type’s fields.
If the conversion is successful, a non-empty map is returned.
If the conversion fails, None is returned.
Provided Methods§
sourcefn check_fields(&self) -> Result<(), Error>
fn check_fields(&self) -> Result<(), Error>
Checks the fields of the implementing type.
Returns a Result indicating whether the fields are valid or not.
If the fields are valid, the Ok variant is returned with an empty () value.
If the fields are invalid, an Err variant is returned with an associated Error value.