pub struct Error<'a> { /* private fields */ }Expand description
An error definition in Varlink IDL.
Implementations§
Source§impl<'a> Error<'a>
impl<'a> Error<'a>
Sourcepub const fn new(
name: &'a str,
fields: &'a [&'a Field<'a>],
comments: &'a [&'a Comment<'a>],
) -> Self
pub const fn new( name: &'a str, fields: &'a [&'a Field<'a>], comments: &'a [&'a Comment<'a>], ) -> Self
Creates a new error with the given name, borrowed fields, and comments.
Sourcepub fn new_owned(
name: &'a str,
fields: Vec<Field<'a>>,
comments: Vec<Comment<'a>>,
) -> Self
pub fn new_owned( name: &'a str, fields: Vec<Field<'a>>, comments: Vec<Comment<'a>>, ) -> Self
Creates a new error with the given name, owned fields, and comments.
Same as new but takes fields by value.
Sourcepub fn fields(&self) -> impl Iterator<Item = &Field<'a>>
pub fn fields(&self) -> impl Iterator<Item = &Field<'a>>
Returns an iterator over the fields of the error.
Sourcepub fn has_no_fields(&self) -> bool
pub fn has_no_fields(&self) -> bool
Returns true if the error has no fields.
Trait Implementations§
impl<'a> Eq for Error<'a>
Auto Trait Implementations§
impl<'a> Freeze for Error<'a>
impl<'a> RefUnwindSafe for Error<'a>
impl<'a> Send for Error<'a>
impl<'a> Sync for Error<'a>
impl<'a> Unpin for Error<'a>
impl<'a> UnwindSafe for Error<'a>
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