pub struct ReprOptions {
pub repr_algo: ReprAlgorithm,
pub align_modif: Option<AlignmentModifier>,
pub transparent: bool,
pub explicit_discr_type: bool,
}Expand description
The representation options as annotated by the user.
NOTE: This does not include less common/unstable representations such as #[repr(simd)]
or the compiler internal #[repr(linear)]. Similarly, enum discriminant representations
are encoded in Variant::discriminant and DiscriminantLayout instead.
This only stores whether the discriminant type was derived from an explicit annotation.
Fields§
§repr_algo: ReprAlgorithm§align_modif: Option<AlignmentModifier>§transparent: bool§explicit_discr_type: boolImplementations§
Source§impl ReprOptions
impl ReprOptions
Sourcepub fn guarantees_fixed_field_order(&self) -> bool
pub fn guarantees_fixed_field_order(&self) -> bool
Whether this representation options guarantee a fixed field ordering for the type.
Since we don’t support repr(simd) or repr(linear) yet, this is
the case if it’s either repr(C) or an explicit discriminant type for
an enum with fields (if it doesn’t have fields, this obviously doesn’t matter anyway).
Cf. https://doc.rust-lang.org/reference/type-layout.html#r-layout.repr.c.struct and https://doc.rust-lang.org/reference/type-layout.html#r-layout.repr.primitive.adt.
Trait Implementations§
Source§impl Clone for ReprOptions
impl Clone for ReprOptions
Source§fn clone(&self) -> ReprOptions
fn clone(&self) -> ReprOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReprOptions
impl Debug for ReprOptions
Source§impl<'de> Deserialize<'de> for ReprOptions
impl<'de> Deserialize<'de> for ReprOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ReprOptions
impl PartialEq for ReprOptions
Source§impl Serialize for ReprOptions
impl Serialize for ReprOptions
impl Eq for ReprOptions
impl StructuralPartialEq for ReprOptions
Auto Trait Implementations§
impl Freeze for ReprOptions
impl RefUnwindSafe for ReprOptions
impl Send for ReprOptions
impl Sync for ReprOptions
impl Unpin for ReprOptions
impl UnwindSafe for ReprOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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