pub(crate) struct SegmentView<'a> {
inner: MemoryInner<'a>,
slice: usize,
lane: usize,
}Expand description
A view into Argon2 memory for a particular segment (i.e. slice × lane).
Fields§
§inner: MemoryInner<'a>§slice: usize§lane: usizeImplementations§
Source§impl<'a> SegmentView<'a>
impl<'a> SegmentView<'a>
Sourceunsafe fn new(inner: MemoryInner<'a>, slice: usize, lane: usize) -> Self
unsafe fn new(inner: MemoryInner<'a>, slice: usize, lane: usize) -> Self
Create a view into Argon2 memory for a particular segment (i.e. slice × lane).
§Safety
At any time, there can be at most one view for a given Argon2 segment. Additionally, all concurrent segment views must be for the same slice.
Sourcepub fn get_block(&self, index: usize) -> &Block
pub fn get_block(&self, index: usize) -> &Block
Get a shared reference to a block.
§Panics
Panics if the index is out of bounds or if the desired block could be mutably aliased (if it is on the current slice but on a different lane/segment).
Sourcepub fn get_block_mut(&mut self, index: usize) -> &mut Block
pub fn get_block_mut(&mut self, index: usize) -> &mut Block
Get a mutable reference to a block.
§Panics
Panics if the index is out of bounds or if the desired block lies outside this segment.
Auto Trait Implementations§
impl<'a> Freeze for SegmentView<'a>
impl<'a> RefUnwindSafe for SegmentView<'a>
impl<'a> Send for SegmentView<'a>
impl<'a> Sync for SegmentView<'a>
impl<'a> Unpin for SegmentView<'a>
impl<'a> UnsafeUnpin for SegmentView<'a>
impl<'a> !UnwindSafe for SegmentView<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more