pub enum ViewLength {
Fixed(usize),
Tracking,
}Expand description
How long a view is, which for a resizable buffer is not a constant.
new Uint8Array(resizableBuffer) with no length argument is length-tracking
(§23.2.5.1 step 8: the length comes out auto): the view has no length of its own, it
has a rule for computing one from the buffer’s current byte length. Growing the
buffer therefore grows the view, and shrinking it to nothing empties the view without
detaching anything. An explicit length — or a view of a fixed-length buffer — is the
other case, and its length stays put while the buffer may not fit it any more.
Variants§
Fixed(usize)
The length the view was created with, in its own units.
Tracking
Recomputed from the buffer’s byte length on every access.
Implementations§
Source§impl ViewLength
impl ViewLength
Trait Implementations§
Source§impl Clone for ViewLength
impl Clone for ViewLength
impl Copy for ViewLength
Source§impl Debug for ViewLength
impl Debug for ViewLength
impl Eq for ViewLength
Source§impl PartialEq for ViewLength
impl PartialEq for ViewLength
impl StructuralPartialEq for ViewLength
Auto Trait Implementations§
impl Forget for ViewLength
impl Freeze for ViewLength
impl Move for ViewLength
impl RefUnwindSafe for ViewLength
impl Send for ViewLength
impl Sync for ViewLength
impl Unpin for ViewLength
impl UnsafeUnpin for ViewLength
impl UnwindSafe for ViewLength
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