Struct optional_error::OptionalError
source · pub struct OptionalError(_);
Expand description
Represents an Option<syn::Error>
.
Implementations§
source§impl OptionalError
impl OptionalError
sourcepub fn new(error: Error) -> Self
pub fn new(error: Error) -> Self
Create a new OptionalError
with the given error.
sourcepub fn error_mut(&mut self) -> Option<&mut Error>
pub fn error_mut(&mut self) -> Option<&mut Error>
Returns a mutable reference to the contained error, if any.
sourcepub fn replace(&mut self, error: Error) -> Option<Error>
pub fn replace(&mut self, error: Error) -> Option<Error>
Replaces the contained error with the given one.
Returns the previous error, if any.
Trait Implementations§
source§impl Default for OptionalError
impl Default for OptionalError
source§fn default() -> OptionalError
fn default() -> OptionalError
Returns the “default value” for a type. Read more