pub struct CompactVertexMapper { /* private fields */ }Expand description
Vertex ID converter for compact representations
Implementations§
Source§impl CompactVertexMapper
impl CompactVertexMapper
Sourcepub fn from_vertices(vertices: &[VertexId]) -> Self
pub fn from_vertices(vertices: &[VertexId]) -> Self
Create from vertex list
Sourcepub fn get_or_insert(&mut self, original: VertexId) -> u16
pub fn get_or_insert(&mut self, original: VertexId) -> u16
Get compact ID, creating if needed
Sourcepub fn to_original(&self, compact: u16) -> Option<VertexId>
pub fn to_original(&self, compact: u16) -> Option<VertexId>
Get original vertex ID from compact
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompactVertexMapper
impl RefUnwindSafe for CompactVertexMapper
impl Send for CompactVertexMapper
impl Sync for CompactVertexMapper
impl Unpin for CompactVertexMapper
impl UnwindSafe for CompactVertexMapper
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more