pub enum PRepr {
Transparent,
Rust(Option<PrimitiveRepr>),
C(Option<PrimitiveRepr>),
RustcWillCatch,
}Expand description
Parsed representation attribute
Variants§
Transparent
#[repr(transparent)]
Rust(Option<PrimitiveRepr>)
#[repr(Rust)] with optional primitive type
C(Option<PrimitiveRepr>)
#[repr(C)] with optional primitive type
RustcWillCatch
A repr error that rustc will catch (e.g., conflicting hints). We use this sentinel to avoid emitting our own misleading errors.
Implementations§
Source§impl PRepr
impl PRepr
Sourcepub fn parse(s: &ReprInner) -> Result<Option<Self>, ParseError>
pub fn parse(s: &ReprInner) -> Result<Option<Self>, ParseError>
Parse a &str (for example a value coming from #[repr(…)] attribute)
into a PRepr variant.
Returns Err(ParseError::RustcWillCatch { .. }) for errors that rustc
will catch on its own (conflicting repr hints). Returns
Err(ParseError::FacetError { .. }) for facet-specific errors like
unsupported repr types (e.g., packed).
Trait Implementations§
impl Copy for PRepr
impl Eq for PRepr
impl StructuralPartialEq for PRepr
Auto Trait Implementations§
impl Freeze for PRepr
impl RefUnwindSafe for PRepr
impl Send for PRepr
impl Sync for PRepr
impl Unpin for PRepr
impl UnwindSafe for PRepr
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