pub(super) struct SubdiagnosticVariant {
pub(super) kind: SubdiagnosticKind,
pub(super) slug: Option<Path>,
pub(super) no_span: bool,
}Fields§
§kind: SubdiagnosticKind§slug: Option<Path>§no_span: boolImplementations§
Source§impl SubdiagnosticVariant
impl SubdiagnosticVariant
Sourcepub(super) fn from_attr(
attr: &Attribute,
fields: &impl HasFieldMap,
) -> Result<Option<SubdiagnosticVariant>, DiagnosticDeriveError>
pub(super) fn from_attr( attr: &Attribute, fields: &impl HasFieldMap, ) -> Result<Option<SubdiagnosticVariant>, DiagnosticDeriveError>
Constructs a SubdiagnosticVariant from a field or type attribute such as #[note],
#[error(parser::add_paren, no_span)] or #[suggestion(code = "...")]. Returns the
SubdiagnosticKind and the diagnostic slug, if specified.
Auto Trait Implementations§
impl Freeze for SubdiagnosticVariant
impl RefUnwindSafe for SubdiagnosticVariant
impl !Send for SubdiagnosticVariant
impl !Sync for SubdiagnosticVariant
impl Unpin for SubdiagnosticVariant
impl UnwindSafe for SubdiagnosticVariant
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more