Struct swh_graph::map::OwnedPermutation
source · pub struct OwnedPermutation<T: Sync + AsRef<[usize]>>(/* private fields */);
Expand description
A Permutation
backed by an usize
vector
Implementations§
source§impl<T: Sync + AsRef<[usize]>> OwnedPermutation<T>
impl<T: Sync + AsRef<[usize]>> OwnedPermutation<T>
sourcepub unsafe fn new_unchecked(perm: T) -> Self
pub unsafe fn new_unchecked(perm: T) -> Self
Creates a permutation
Safety
This function is not unsafe per-se, but it does not check node ids in the permutation’s image are correct or unique, which will violate assumptions of other unsafe functions down the line.
sourcepub fn new(perm: T) -> Result<Self>
pub fn new(perm: T) -> Result<Self>
Creates a permutation, or returns an error in case the permutation is incorrect
pub fn dump<W: Write>(&self, file: &mut W) -> Result<()>
source§impl<T: Sync + AsRef<[usize]> + AsMut<[usize]>> OwnedPermutation<T>
impl<T: Sync + AsRef<[usize]> + AsMut<[usize]>> OwnedPermutation<T>
sourcepub fn compose_in_place<T2: Permutation + Sync>(
&mut self,
other: T2
) -> Result<()>
pub fn compose_in_place<T2: Permutation + Sync>( &mut self, other: T2 ) -> Result<()>
Applies the other permutation to self
, so self
becomes a new permutation.
source§impl OwnedPermutation<Vec<usize>>
impl OwnedPermutation<Vec<usize>>
sourcepub unsafe fn load_unchecked(num_nodes: usize, path: &Path) -> Result<Self>
pub unsafe fn load_unchecked(num_nodes: usize, path: &Path) -> Result<Self>
Loads a permutation from disk and returns IO errors if any.
Safety
This function is not unsafe per-se, but it does not check node ids in the permutation’s image are correct or unique, which will violate assumptions of other unsafe functions down the line.
Trait Implementations§
source§impl<T: Sync + AsRef<[usize]>> Permutation for OwnedPermutation<T>
impl<T: Sync + AsRef<[usize]>> Permutation for OwnedPermutation<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for OwnedPermutation<T>where T: RefUnwindSafe,
impl<T> Send for OwnedPermutation<T>where T: Send,
impl<T> Sync for OwnedPermutation<T>
impl<T> Unpin for OwnedPermutation<T>where T: Unpin,
impl<T> UnwindSafe for OwnedPermutation<T>where T: UnwindSafe,
Blanket Implementations§
§impl<T> BitFieldSliceMut<usize> for Twhere
T: AsMut<[usize]> + AsRef<[usize]>,
impl<T> BitFieldSliceMut<usize> for Twhere T: AsMut<[usize]> + AsRef<[usize]>,
§unsafe fn set_unchecked(&mut self, index: usize, value: usize)
unsafe fn set_unchecked(&mut self, index: usize, value: usize)
Set the element of the slice at the specified index.
No bounds checking is performed. Read more
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
§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere U: CastableFrom<T>,
§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere U: DowncastableFrom<T>,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.