[−][src]Enum bitvec::domain::BitDomainMut
Granular representation of the memory region containing a
BitSlice
.
BitSlice
regions can be described in terms of edge and center
elements, where the edge elements retain the aliasing status of the
source BitSlice
handle, and the center elements are known to be
completely unaliased by any other view. This property allows any
BitSlice
handle to be decomposed into smaller regions, and safely
remove any aliasing markers from the subregion of memory that no
longer requires them for correct access.
This enum acts like the .split*
methods in that it only subdivides
the source BitSlice
into smaller BitSlices
, and makes
appropriate modifications to the aliasing markers. It does not
provide references to the underlying memory elements. If you need
such access directly, use the Domain
or DomainMut
enums.
Lifetimes
'a
: The lifetime of the referent storage region.
Type Parameters
O
: The ordering type of the sourceBitSlice
handle.T
: The element type of the sourceBitSlice
handle, including aliasing markers.
Variants
Indicates that a BitSlice
is contained entirely in the
interior indices of a single memory element.
Fields of Enclave
head: BitIdx<T::Mem>
The start index of the BitSlice
.
This is not likely to be useful information, but is retained for structural similarity with the rest of the module.
body: &'a mut BitSlice<O, T>
The original BitSlice
used to create this bit-domain view.
tail: BitTail<T::Mem>
The end index of the BitSlice
.
This is not likely to be useful information, but is retained for structural similarity with the rest of the module.
Indicates that a BitSlice
region touches at least one edge
index of any number of elements.
This contains two bitslices representing the partially-occupied edge elements, with their original aliasing marker, and one bitslice representing the fully-occupied interior elements, marked as unaliased.
Fields of Region
head: &'a mut BitSlice<O, T>
Any bits that partially-fill the base element of the slice region.
This does not modify its aliasing status, as it will already be appropriately marked before constructing this view.
body: &'a mut BitSlice<O, T::Mem>
Any bits inside elements that the source bitslice completely covers.
This is marked as unaliased, because it is statically impossible for any other handle to have write access to the region it covers. As such, a bitslice that was marked as entirely aliased, but contains interior unaliased elements, can safely remove its aliasing protections.
Safety Exception
&BitSlice<O, T::Alias>
references have access to a
.set_aliased
method, which represents the only means in
bitvec
of writing to memory without an exclusive &mut
reference.
Construction of two such shared, aliasing, references over
the same data, then construction of a bit-domain view over
one of them and simultaneous writing through the other to
interior elements marked as unaliased, will cause the
bit-domain view to be undefined behavior. Do not combine
bit-domain views and .set_aliased
calls.
tail: &'a mut BitSlice<O, T>
Any bits that partially fill the last element of the slice region.
This does not modify its aliasing status, as it will already be appropriately marked before constructing this view.
Implementations
impl<'a, O, T> BitDomainMut<'a, O, T> where
O: BitOrder,
T: 'a + BitStore,
[src]
O: BitOrder,
T: 'a + BitStore,
pub fn enclave(
self
) -> Option<(BitIdx<T::Mem>, &'a mut BitSlice<O, T>, BitTail<T::Mem>)>
[src]
self
) -> Option<(BitIdx<T::Mem>, &'a mut BitSlice<O, T>, BitTail<T::Mem>)>
Attempts to view the domain as an enclave variant.
Parameters
self
Returns
If self
is the Enclave
variant, this returns Some
of the
enclave fields, as a tuple. Otherwise, it returns None
.
pub fn region(
self
) -> Option<(&'a mut BitSlice<O, T>, &'a mut BitSlice<O, T::Mem>, &'a mut BitSlice<O, T>)>
[src]
self
) -> Option<(&'a mut BitSlice<O, T>, &'a mut BitSlice<O, T::Mem>, &'a mut BitSlice<O, T>)>
Attempts to view the domain as a region variant.
Parameters
self
Returns
If self
is the Region
variant, this returns Some
of the
region fields, as a tuple. Otherwise, it returns None
.
Trait Implementations
impl<'a, O: Debug, T: Debug> Debug for BitDomainMut<'a, O, T> where
O: BitOrder,
T: 'a + BitStore,
T::Mem: Debug,
T::Mem: Debug,
T::Mem: Debug,
[src]
O: BitOrder,
T: 'a + BitStore,
T::Mem: Debug,
T::Mem: Debug,
T::Mem: Debug,
Auto Trait Implementations
impl<'a, O, T> RefUnwindSafe for BitDomainMut<'a, O, T> where
O: RefUnwindSafe,
T: RefUnwindSafe,
<T as BitStore>::Mem: RefUnwindSafe,
O: RefUnwindSafe,
T: RefUnwindSafe,
<T as BitStore>::Mem: RefUnwindSafe,
impl<'a, O, T> Send for BitDomainMut<'a, O, T> where
<T as BitStore>::Mem: BitStore + Send,
<T as BitStore>::Threadsafe: Send,
<<T as BitStore>::Mem as BitStore>::Threadsafe: Send,
<T as BitStore>::Mem: BitStore + Send,
<T as BitStore>::Threadsafe: Send,
<<T as BitStore>::Mem as BitStore>::Threadsafe: Send,
impl<'a, O, T> Sync for BitDomainMut<'a, O, T> where
<T as BitStore>::Mem: BitStore + Sync,
<T as BitStore>::Threadsafe: Sync,
<<T as BitStore>::Mem as BitStore>::Threadsafe: Sync,
<T as BitStore>::Mem: BitStore + Sync,
<T as BitStore>::Threadsafe: Sync,
<<T as BitStore>::Mem as BitStore>::Threadsafe: Sync,
impl<'a, O, T> Unpin for BitDomainMut<'a, O, T> where
<T as BitStore>::Mem: Unpin,
<T as BitStore>::Mem: Unpin,
impl<'a, O, T> !UnwindSafe for BitDomainMut<'a, O, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> Conv for T
[src]
impl<T> FmtForward for T
[src]
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
[src]
Self: Binary,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
[src]
Self: Display,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
[src]
Self: LowerExp,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
[src]
Self: LowerHex,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
[src]
Self: Octal,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
[src]
Self: Pointer,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
[src]
Self: UpperExp,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
[src]
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T
[src]
impl<T> PipeAsRef for T
[src]
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: AsRef<T>,
T: 'a,
[src]
R: 'a,
Self: AsRef<T>,
T: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
R: 'a,
Self: AsMut<T>,
T: 'a,
[src]
R: 'a,
Self: AsMut<T>,
T: 'a,
impl<T> PipeBorrow for T
[src]
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: Borrow<T>,
T: 'a,
[src]
R: 'a,
Self: Borrow<T>,
T: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
[src]
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
impl<T> PipeDeref for T
[src]
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
R: 'a,
Self: Deref,
[src]
R: 'a,
Self: Deref,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
[src]
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
impl<T> PipeRef for T
[src]
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
[src]
R: 'a,
fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
[src]
R: 'a,
impl<T> Tap for T
[src]
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
[src]
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
[src]
F: FnOnce(&Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
[src]
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
[src]
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
[src]
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
[src]
F: FnOnce(&T) -> R,
Self: AsRef<T>,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
[src]
F: FnOnce(&T) -> R,
Self: AsRef<T>,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
[src]
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
[src]
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
[src]
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
[src]
F: FnOnce(&T) -> R,
Self: Borrow<T>,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
[src]
F: FnOnce(&T) -> R,
Self: Borrow<T>,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
[src]
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
[src]
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
impl<T> TapDeref for T
[src]
fn tap_deref<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
[src]
F: FnOnce(&Self::Target) -> R,
Self: Deref,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
[src]
F: FnOnce(&Self::Target) -> R,
Self: Deref,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
[src]
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
[src]
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
impl<T> TryConv 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>,