pub struct IdMap { /* private fields */ }Expand description
Bi-directional mapping between an integer id and a name ([u8]).
Backed by the filesystem.
Implementations§
Source§impl IdMap
impl IdMap
Sourcepub fn find_name_by_id(&self, id: Id) -> Result<Option<&[u8]>>
pub fn find_name_by_id(&self, id: Id) -> Result<Option<&[u8]>>
Find name by a specified integer id.
Sourcepub fn find_vertex_name_by_id(&self, id: Id) -> Result<Option<VertexName>>
pub fn find_vertex_name_by_id(&self, id: Id) -> Result<Option<VertexName>>
Find VertexName by a specified integer id.
Sourcepub fn find_id_by_name(&self, name: &[u8]) -> Result<Option<Id>>
pub fn find_id_by_name(&self, name: &[u8]) -> Result<Option<Id>>
Find the integer id matching the given name.
Trait Implementations§
Source§impl IdConvert for IdMap
impl IdConvert for IdMap
fn vertex_id<'life0, 'async_trait>(
&'life0 self,
name: VertexName,
) -> Pin<Box<dyn Future<Output = Result<Id>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn vertex_id_with_max_group<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 VertexName,
max_group: Group,
) -> Pin<Box<dyn Future<Output = Result<Option<Id>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn vertex_name<'life0, 'async_trait>(
&'life0 self,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<VertexName>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn contains_vertex_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 VertexName,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn contains_vertex_id_locally<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Id],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains_vertex_id_locally<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Id],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Test if an
id is present locally. Do not trigger remote fetching.Source§fn contains_vertex_name_locally<'life0, 'life1, 'async_trait>(
&'life0 self,
names: &'life1 [VertexName],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains_vertex_name_locally<'life0, 'life1, 'async_trait>(
&'life0 self,
names: &'life1 [VertexName],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Test if an
name is present locally. Do not trigger remote fetching.Source§fn map_version(&self) -> &VerLink
fn map_version(&self) -> &VerLink
Version of the map. Useful to figure out compatibility between two maps.
fn vertex_id_optional<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 VertexName,
) -> Pin<Box<dyn Future<Output = Result<Option<Id>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn vertex_name_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Id],
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<VertexName>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn vertex_name_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Id],
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<VertexName>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Convert
Ids to VertexNames in batch.Source§fn vertex_id_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
names: &'life1 [VertexName],
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Id>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn vertex_id_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
names: &'life1 [VertexName],
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Id>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Convert
VertexNames to Ids in batch.Source§impl IdMapWrite for IdMap
impl IdMapWrite for IdMap
Source§impl Persist for IdMap
impl Persist for IdMap
Source§impl PrefixLookup for IdMap
impl PrefixLookup for IdMap
Auto Trait Implementations§
impl Freeze for IdMap
impl !RefUnwindSafe for IdMap
impl Send for IdMap
impl Sync for IdMap
impl Unpin for IdMap
impl !UnwindSafe for IdMap
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> IdMapAssignHead for Twhere
T: IdConvert + IdMapWrite,
impl<T> IdMapAssignHead for Twhere
T: IdConvert + IdMapWrite,
Source§fn assign_head<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
head: VertexName,
parents_by_name: &'life1 dyn Parents,
group: Group,
covered_ids: &'life2 mut IdSet,
reserved_ids: &'life3 IdSet,
) -> Pin<Box<dyn Future<Output = Result<PreparedFlatSegments>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn assign_head<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
head: VertexName,
parents_by_name: &'life1 dyn Parents,
group: Group,
covered_ids: &'life2 mut IdSet,
reserved_ids: &'life3 IdSet,
) -> Pin<Box<dyn Future<Output = Result<PreparedFlatSegments>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Assign an id for a head in a DAG. This implies ancestors of the
head will also have ids assigned. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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