[−][src]Struct bitvec::slice::BitGuard
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 Deref
s 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]
C: Cursor,
T: 'a + BitStore,
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]
C: Cursor,
T: 'a + BitStore,
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]
C: Cursor,
T: 'a + BitStore,
impl<'a, C, T> Deref for BitGuard<'a, C, T> where
C: Cursor,
T: 'a + BitStore,
[src]
C: Cursor,
T: 'a + BitStore,
Read from the local cache.
impl<'a, C, T> DerefMut for BitGuard<'a, C, T> where
C: Cursor,
T: 'a + BitStore,
[src]
C: Cursor,
T: 'a + BitStore,
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,
C: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,