[][src]Struct rfc::core::convert::transmute::options::NeglectStability

pub struct NeglectStability;

Neglect the static stability check.

By default, TransmuteFrom and TransmuteInto require that the layouts of the source and destination types are SemVer-stable. The NeglectStability option disables this requirement.

Prior to the adoption of the stability declaration traits, crate authors documented the layout guarantees of their types with doc comments. The TransmuteFrom and TransmuteInto traits and methods may be used with these types by requesting that the stability check is neglected; for instance:

fn serialize<W: Write>(val : LibraryType, dst: W) -> std::io::Result<()>
where
    LibraryType: TransmuteInto<[u8; size_of::<LibraryType>()], NeglectStability>
{
    ...
}

Neglecting stability over-eagerly cannot cause unsoundness or unsafety. For this reason, it is the only transmutation option available on the safe methods transmute_from and transmute_into. However, neglecting stability over-eagerly may cause your code to cease compiling if the authors of the source and destination types make changes that affect their layout.

By using the NeglectStability option to transmute types you do not own, you are committing to ensure that your reliance on these types' layouts is consistent with their documented stability guarantees.

Trait Implementations

impl SafeTransmuteOptions for NeglectStability[src]

impl TransmuteOptions for NeglectStability[src]

Auto Trait Implementations

impl RefUnwindSafe for NeglectStability

impl Send for NeglectStability

impl Sync for NeglectStability

impl Unpin for NeglectStability

impl UnwindSafe for NeglectStability

Blanket Implementations

impl<Lhs, Rhs, Neglect> AlignEq<Rhs, Neglect> for Lhs where
    Lhs: AlignLtEq<Rhs, ()>,
    Neglect: TransmuteOptions,
    Rhs: AlignLtEq<Lhs, ()>, 
[src]

impl<Lhs, Rhs, Neglect> AlignLtEq<Rhs, Neglect> for Lhs where
    Neglect: TransmuteOptions,
    &'a [Lhs; 0]: for<'a> TransmuteFrom<&'a [Rhs; 0], Neglect>, 
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Src, Dst, Neglect> CastInto<Dst, Neglect> for Src where
    Dst: CastFrom<Src, Neglect>,
    Neglect: CastOptions
[src]

impl<Neglect> CastOptions for Neglect where
    Neglect: SliceCastOptions
[src]

impl<Neglect> CastOptions for Neglect where
    Neglect: VecCastOptions
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Neglect> SafeCastOptions for Neglect where
    Neglect: SafeSliceCastOptions
[src]

impl<Neglect> SafeCastOptions for Neglect where
    Neglect: SafeVecCastOptions
[src]

impl<Neglect> SafeSliceCastOptions for Neglect where
    Neglect: SafeTransmuteOptions
[src]

impl<Neglect> SafeVecCastOptions for Neglect where
    Neglect: SafeTransmuteOptions
[src]

impl<Neglect> SliceCastOptions for Neglect where
    Neglect: TransmuteOptions
[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<T> TransmuteFrom<T, NeglectStability> for T[src]

impl<Src, Dst, Neglect> TransmuteInto<Dst, Neglect> for Src where
    Dst: TransmuteFrom<Src, Neglect> + ?Sized,
    Neglect: TransmuteOptions,
    Src: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Neglect> VecCastOptions for Neglect where
    Neglect: TransmuteOptions
[src]