Skip to main content

ToId

Trait ToId 

Source
pub trait ToId<T>: Debug + AsyncFriendly {
    // Required method
    fn to_id(&self, i: usize) -> ANNResult<T>;
}
Expand description

Convert an implicit data index to an external ID.

The crate::build::Build trait uses indices in a range 0..N to refer to items for insertion. This trait provides a bridge between these indices and the actual external ID type used by a diskann::provider::DataProvider.

Required Methods§

Source

fn to_id(&self, i: usize) -> ANNResult<T>

Convert the given implicit index i to an external ID of type T.

Implementors§

Source§

impl ToId<u32> for Range<u32>

Source§

impl<T> ToId<T> for Identity<T>

Source§

impl<T> ToId<T> for Slice<T>
where T: Clone + Debug + AsyncFriendly,