Struct bitvec::ptr::Address[][src]

#[repr(transparent)]
pub struct Address<M, T = usize> where
    M: Mutability,
    T: BitStore
{ /* fields omitted */ }

A non-null, well-aligned, BitStore element address.

This adds non-null and well-aligned requirements to memory addresses so that the crate can rely on these invariants throughout its implementation. The type is public API, but opaque, and only constructible through conversions of pointer and reference values.

Type Parameters

  • M: The mutability permissions of the source pointer.
  • T: The referent type of the source pointer.

Implementations

impl<M, T> Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

pub fn to_const(self) -> *const T[src]

Gets the address as a read-only pointer.

impl<T> Address<Mut, T> where
    T: BitStore
[src]

pub fn to_mut(self) -> *mut T[src]

Gets the address as a write-capable pointer.

Trait Implementations

impl<M, T> Clone for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<M, T> Copy for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<M, T> Debug for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<M, T> Eq for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<T> From<&'_ T> for Address<Const, T> where
    T: BitStore
[src]

impl<T> From<&'_ mut T> for Address<Mut, T> where
    T: BitStore
[src]

impl<M, T> Hash for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<M, T> Ord for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<M1, M2, T1, T2> PartialEq<Address<M2, T2>> for Address<M1, T1> where
    M1: Mutability,
    M2: Mutability,
    T1: BitStore,
    T2: BitStore
[src]

impl<M1, M2, T1, T2> PartialOrd<Address<M2, T2>> for Address<M1, T1> where
    M1: Mutability,
    M2: Mutability,
    T1: BitStore,
    T2: BitStore
[src]

impl<M, T> Pointer for Address<M, T> where
    M: Mutability,
    T: BitStore
[src]

impl<T> TryFrom<*const T> for Address<Const, T> where
    T: BitStore
[src]

type Error = AddressError<T>

The type returned in the event of a conversion error.

impl<T> TryFrom<*mut T> for Address<Mut, T> where
    T: BitStore
[src]

type Error = AddressError<T>

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<M, T> RefUnwindSafe for Address<M, T> where
    M: RefUnwindSafe,
    T: RefUnwindSafe

impl<M, T = usize> !Send for Address<M, T>

impl<M, T = usize> !Sync for Address<M, T>

impl<M, T> Unpin for Address<M, T> where
    M: Unpin

impl<M, T> UnwindSafe for Address<M, T> where
    M: UnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

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<T> Conv for T[src]

impl<T> Conv for T[src]

impl<T> FmtForward for T[src]

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

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

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

impl<T> Pipe for T[src]

impl<T> PipeAsRef for T[src]

impl<T> PipeBorrow for T[src]

impl<T> PipeDeref for T[src]

impl<T> PipeRef for T[src]

impl<T> Tap for T[src]

impl<T> Tap for T[src]

impl<T, U> TapAsRef<U> for T where
    U: ?Sized
[src]

impl<T, U> TapBorrow<U> for T where
    U: ?Sized
[src]

impl<T> TapDeref for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T[src]

impl<T> TryConv for T[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.