pub struct OptionalError(/* private fields */);
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
Auto Trait Implementations§
impl Freeze for OptionalError
impl RefUnwindSafe for OptionalError
impl Send for OptionalError
impl Sync for OptionalError
impl Unpin for OptionalError
impl UnwindSafe for OptionalError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more