[][src]Struct bitvec::slice::BitGuard

pub struct BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
{ /* fields omitted */ }

Write reference to a single bit.

Rust requires that DerefMut produce the plain address of a value which can be written with a memcpy, so, there is no way to make plain write assignments work nicely in Rust. This reference structure is the second best option.

It contains a write reference to a single-bit slice, and a local cache bool. This structure Derefs to the local cache, and commits the cache to the slice on drop. This allows writing to the guard with = assignment.

Trait Implementations

impl<'a, C, T> Send for BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

This type is a mutable reference with extra steps, so, it should be moveable but not shareable.

impl<'a, C, T> Drop for BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

Commit the local cache to the backing slice.

impl<'a, C: Debug, T: Debug> Debug for BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

impl<'a, C, T> Deref for BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

Read from the local cache.

type Target = bool

The resulting type after dereferencing.

impl<'a, C, T> DerefMut for BitGuard<'a, C, T> where
    C: Cursor,
    T: 'a + BitStore
[src]

Write to the local cache.

Auto Trait Implementations

impl<'a, C, T> !Sync for BitGuard<'a, C, T>

impl<'a, C, T> Unpin for BitGuard<'a, C, T>

impl<'a, C, T> !UnwindSafe for BitGuard<'a, C, T>

impl<'a, C, T> RefUnwindSafe for BitGuard<'a, C, T> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> 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.

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

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

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