pub struct MaskTrackedArrayBase<T, M, const N: usize>where
Self: MaskTrackedArray<T, MaskType = M>,{ /* private fields */ }Expand description
An array with slots for values backed by a mask for tracking which slots
are under use. Each slot has their own UnsafeCell.
Trait Implementations§
Source§impl<T> Default for MaskTrackedArrayBase<T, u128, 128>
impl<T> Default for MaskTrackedArrayBase<T, u128, 128>
Source§impl<T> Default for MaskTrackedArrayBase<T, u16, 16>
impl<T> Default for MaskTrackedArrayBase<T, u16, 16>
Source§impl<T> Default for MaskTrackedArrayBase<T, u32, 32>
impl<T> Default for MaskTrackedArrayBase<T, u32, 32>
Source§impl<T> Default for MaskTrackedArrayBase<T, u64, 64>
impl<T> Default for MaskTrackedArrayBase<T, u64, 64>
Source§impl<T> Default for MaskTrackedArrayBase<T, u8, 8>
impl<T> Default for MaskTrackedArrayBase<T, u8, 8>
Source§impl<T, M, const N: usize> Drop for MaskTrackedArrayBase<T, M, N>where
Self: MaskTrackedArray<T, MaskType = M>,
impl<T, M, const N: usize> Drop for MaskTrackedArrayBase<T, M, N>where
Self: MaskTrackedArray<T, MaskType = M>,
Source§impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u128, 128>
impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u128, 128>
Source§impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u16, 16>
impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u16, 16>
Source§impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u32, 32>
impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u32, 32>
Source§impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u64, 64>
impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u64, 64>
Source§impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u8, 8>
impl<T> FromIterator<(usize, T)> for MaskTrackedArrayBase<T, u8, 8>
Source§impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u128, 128>
impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u128, 128>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u16, 16>
impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u16, 16>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u32, 32>
impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u32, 32>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u64, 64>
impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u64, 64>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u8, 8>
impl<T> FromIterator<T> for MaskTrackedArrayBase<T, u8, 8>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> IntoIterator for MaskTrackedArrayBase<T, u128, 128>
impl<T> IntoIterator for MaskTrackedArrayBase<T, u128, 128>
Source§impl<T> IntoIterator for MaskTrackedArrayBase<T, u16, 16>
impl<T> IntoIterator for MaskTrackedArrayBase<T, u16, 16>
Source§impl<T> IntoIterator for MaskTrackedArrayBase<T, u32, 32>
impl<T> IntoIterator for MaskTrackedArrayBase<T, u32, 32>
Source§impl<T> IntoIterator for MaskTrackedArrayBase<T, u64, 64>
impl<T> IntoIterator for MaskTrackedArrayBase<T, u64, 64>
Source§impl<T> IntoIterator for MaskTrackedArrayBase<T, u8, 8>
impl<T> IntoIterator for MaskTrackedArrayBase<T, u8, 8>
Source§impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u128, 128>
impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u128, 128>
Source§fn contains_item_at(&self, index: usize) -> bool
fn contains_item_at(&self, index: usize) -> bool
Check if there is an item at a slot. This function will also return
false if the index is out of range.
Source§unsafe fn get_unchecked_ref(&self, index: usize) -> &T
unsafe fn get_unchecked_ref(&self, index: usize) -> &T
Get an immutable reference to slot without bounds or validity checking. Read more
Source§unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
Get a mutable reference to a slot without bounds, validity or borrow
checking. Read more
Source§fn clear(&mut self)
fn clear(&mut self)
Clear out all items in this array, returning to its empty state. Drop
is called if needed.
Source§unsafe fn insert_unchecked(&self, index: usize, value: T)
unsafe fn insert_unchecked(&self, index: usize, value: T)
Insert an item at a given index without bounds, validity or borrow
checking. Read more
Source§unsafe fn remove_unchecked(&self, index: usize) -> T
unsafe fn remove_unchecked(&self, index: usize) -> T
Remove a value from a slot without checking the index or if the item is
there. Read more
Source§fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices.
Source§fn iter_filled_indices_mask(
&self,
mask: Self::MaskType,
) -> impl Iterator<Item = usize>
fn iter_filled_indices_mask( &self, mask: Self::MaskType, ) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices also present in the given
mask.
Source§fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all unfilled slot indices.
Source§fn get_ref(&self, index: usize) -> Option<&T>
fn get_ref(&self, index: usize) -> Option<&T>
Get a reference to an item inside a slot if available.
Source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get a mutable reference to an item inside a slot if available.
Source§fn insert(&self, index: usize, value: T) -> Option<T>
fn insert(&self, index: usize, value: T) -> Option<T>
Try to insert an item at a given index. If insertion fails, return
the value in an option. If the option is none then the insertion
succeeded.
Source§fn remove(&mut self, index: usize) -> Option<T>
fn remove(&mut self, index: usize) -> Option<T>
Remove a value at a specific index and return it if available.
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references to every filled slot.
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
Iterate over mutable references to every filled slot.
Source§fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references which are only present in the given mask.
Source§impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u16, 16>
impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u16, 16>
Source§fn contains_item_at(&self, index: usize) -> bool
fn contains_item_at(&self, index: usize) -> bool
Check if there is an item at a slot. This function will also return
false if the index is out of range.
Source§unsafe fn get_unchecked_ref(&self, index: usize) -> &T
unsafe fn get_unchecked_ref(&self, index: usize) -> &T
Get an immutable reference to slot without bounds or validity checking. Read more
Source§unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
Get a mutable reference to a slot without bounds, validity or borrow
checking. Read more
Source§fn clear(&mut self)
fn clear(&mut self)
Clear out all items in this array, returning to its empty state. Drop
is called if needed.
Source§unsafe fn insert_unchecked(&self, index: usize, value: T)
unsafe fn insert_unchecked(&self, index: usize, value: T)
Insert an item at a given index without bounds, validity or borrow
checking. Read more
Source§unsafe fn remove_unchecked(&self, index: usize) -> T
unsafe fn remove_unchecked(&self, index: usize) -> T
Remove a value from a slot without checking the index or if the item is
there. Read more
Source§fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices.
Source§fn iter_filled_indices_mask(
&self,
mask: Self::MaskType,
) -> impl Iterator<Item = usize>
fn iter_filled_indices_mask( &self, mask: Self::MaskType, ) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices also present in the given
mask.
Source§fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all unfilled slot indices.
Source§fn get_ref(&self, index: usize) -> Option<&T>
fn get_ref(&self, index: usize) -> Option<&T>
Get a reference to an item inside a slot if available.
Source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get a mutable reference to an item inside a slot if available.
Source§fn insert(&self, index: usize, value: T) -> Option<T>
fn insert(&self, index: usize, value: T) -> Option<T>
Try to insert an item at a given index. If insertion fails, return
the value in an option. If the option is none then the insertion
succeeded.
Source§fn remove(&mut self, index: usize) -> Option<T>
fn remove(&mut self, index: usize) -> Option<T>
Remove a value at a specific index and return it if available.
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references to every filled slot.
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
Iterate over mutable references to every filled slot.
Source§fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references which are only present in the given mask.
Source§impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u32, 32>
impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u32, 32>
Source§fn contains_item_at(&self, index: usize) -> bool
fn contains_item_at(&self, index: usize) -> bool
Check if there is an item at a slot. This function will also return
false if the index is out of range.
Source§unsafe fn get_unchecked_ref(&self, index: usize) -> &T
unsafe fn get_unchecked_ref(&self, index: usize) -> &T
Get an immutable reference to slot without bounds or validity checking. Read more
Source§unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
Get a mutable reference to a slot without bounds, validity or borrow
checking. Read more
Source§fn clear(&mut self)
fn clear(&mut self)
Clear out all items in this array, returning to its empty state. Drop
is called if needed.
Source§unsafe fn insert_unchecked(&self, index: usize, value: T)
unsafe fn insert_unchecked(&self, index: usize, value: T)
Insert an item at a given index without bounds, validity or borrow
checking. Read more
Source§unsafe fn remove_unchecked(&self, index: usize) -> T
unsafe fn remove_unchecked(&self, index: usize) -> T
Remove a value from a slot without checking the index or if the item is
there. Read more
Source§fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices.
Source§fn iter_filled_indices_mask(
&self,
mask: Self::MaskType,
) -> impl Iterator<Item = usize>
fn iter_filled_indices_mask( &self, mask: Self::MaskType, ) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices also present in the given
mask.
Source§fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all unfilled slot indices.
Source§fn get_ref(&self, index: usize) -> Option<&T>
fn get_ref(&self, index: usize) -> Option<&T>
Get a reference to an item inside a slot if available.
Source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get a mutable reference to an item inside a slot if available.
Source§fn insert(&self, index: usize, value: T) -> Option<T>
fn insert(&self, index: usize, value: T) -> Option<T>
Try to insert an item at a given index. If insertion fails, return
the value in an option. If the option is none then the insertion
succeeded.
Source§fn remove(&mut self, index: usize) -> Option<T>
fn remove(&mut self, index: usize) -> Option<T>
Remove a value at a specific index and return it if available.
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references to every filled slot.
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
Iterate over mutable references to every filled slot.
Source§fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references which are only present in the given mask.
Source§impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u64, 64>
impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u64, 64>
Source§fn contains_item_at(&self, index: usize) -> bool
fn contains_item_at(&self, index: usize) -> bool
Check if there is an item at a slot. This function will also return
false if the index is out of range.
Source§unsafe fn get_unchecked_ref(&self, index: usize) -> &T
unsafe fn get_unchecked_ref(&self, index: usize) -> &T
Get an immutable reference to slot without bounds or validity checking. Read more
Source§unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
Get a mutable reference to a slot without bounds, validity or borrow
checking. Read more
Source§fn clear(&mut self)
fn clear(&mut self)
Clear out all items in this array, returning to its empty state. Drop
is called if needed.
Source§unsafe fn insert_unchecked(&self, index: usize, value: T)
unsafe fn insert_unchecked(&self, index: usize, value: T)
Insert an item at a given index without bounds, validity or borrow
checking. Read more
Source§unsafe fn remove_unchecked(&self, index: usize) -> T
unsafe fn remove_unchecked(&self, index: usize) -> T
Remove a value from a slot without checking the index or if the item is
there. Read more
Source§fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices.
Source§fn iter_filled_indices_mask(
&self,
mask: Self::MaskType,
) -> impl Iterator<Item = usize>
fn iter_filled_indices_mask( &self, mask: Self::MaskType, ) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices also present in the given
mask.
Source§fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all unfilled slot indices.
Source§fn get_ref(&self, index: usize) -> Option<&T>
fn get_ref(&self, index: usize) -> Option<&T>
Get a reference to an item inside a slot if available.
Source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get a mutable reference to an item inside a slot if available.
Source§fn insert(&self, index: usize, value: T) -> Option<T>
fn insert(&self, index: usize, value: T) -> Option<T>
Try to insert an item at a given index. If insertion fails, return
the value in an option. If the option is none then the insertion
succeeded.
Source§fn remove(&mut self, index: usize) -> Option<T>
fn remove(&mut self, index: usize) -> Option<T>
Remove a value at a specific index and return it if available.
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references to every filled slot.
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
Iterate over mutable references to every filled slot.
Source§fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references which are only present in the given mask.
Source§impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u8, 8>
impl<T> MaskTrackedArray<T> for MaskTrackedArrayBase<T, u8, 8>
Source§fn contains_item_at(&self, index: usize) -> bool
fn contains_item_at(&self, index: usize) -> bool
Check if there is an item at a slot. This function will also return
false if the index is out of range.
Source§unsafe fn get_unchecked_ref(&self, index: usize) -> &T
unsafe fn get_unchecked_ref(&self, index: usize) -> &T
Get an immutable reference to slot without bounds or validity checking. Read more
Source§unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
unsafe fn get_unchecked_mut(&self, index: usize) -> &mut T
Get a mutable reference to a slot without bounds, validity or borrow
checking. Read more
Source§fn clear(&mut self)
fn clear(&mut self)
Clear out all items in this array, returning to its empty state. Drop
is called if needed.
Source§unsafe fn insert_unchecked(&self, index: usize, value: T)
unsafe fn insert_unchecked(&self, index: usize, value: T)
Insert an item at a given index without bounds, validity or borrow
checking. Read more
Source§unsafe fn remove_unchecked(&self, index: usize) -> T
unsafe fn remove_unchecked(&self, index: usize) -> T
Remove a value from a slot without checking the index or if the item is
there. Read more
Source§fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
fn iter_filled_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices.
Source§fn iter_filled_indices_mask(
&self,
mask: Self::MaskType,
) -> impl Iterator<Item = usize>
fn iter_filled_indices_mask( &self, mask: Self::MaskType, ) -> impl Iterator<Item = usize>
Get an iterator over all filled slot indices also present in the given
mask.
Source§fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
fn iter_empty_indices(&self) -> impl Iterator<Item = usize>
Get an iterator over all unfilled slot indices.
Source§fn get_ref(&self, index: usize) -> Option<&T>
fn get_ref(&self, index: usize) -> Option<&T>
Get a reference to an item inside a slot if available.
Source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
Get a mutable reference to an item inside a slot if available.
Source§fn insert(&self, index: usize, value: T) -> Option<T>
fn insert(&self, index: usize, value: T) -> Option<T>
Try to insert an item at a given index. If insertion fails, return
the value in an option. If the option is none then the insertion
succeeded.
Source§fn remove(&mut self, index: usize) -> Option<T>
fn remove(&mut self, index: usize) -> Option<T>
Remove a value at a specific index and return it if available.
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references to every filled slot.
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>where
T: 'a,
Iterate over mutable references to every filled slot.
Source§fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
fn iter_mask<'a>(&'a self, mask: Self::MaskType) -> impl Iterator<Item = &'a T>where
T: 'a,
Iterate over references which are only present in the given mask.
impl<T: Eq> Eq for MaskTrackedArrayBase<T, u128, 128>
impl<T: Eq> Eq for MaskTrackedArrayBase<T, u16, 16>
impl<T: Eq> Eq for MaskTrackedArrayBase<T, u32, 32>
impl<T: Eq> Eq for MaskTrackedArrayBase<T, u64, 64>
impl<T: Eq> Eq for MaskTrackedArrayBase<T, u8, 8>
Auto Trait Implementations§
impl<T, M, const N: usize> !Freeze for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> !RefUnwindSafe for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> Send for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> !Sync for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> Unpin for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> UnsafeUnpin for MaskTrackedArrayBase<T, M, N>
impl<T, M, const N: usize> UnwindSafe for MaskTrackedArrayBase<T, M, N>
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