Skip to main content

BfTreeProvider

Struct BfTreeProvider 

Source
pub struct BfTreeProvider<T, Q = QuantVectorProvider>
where T: VectorRepr,
{ /* private fields */ }
Expand description

An Bf-tree based implementation of a DataProvider built around the idea of having up to two layers of vector stores: a full-precision store and an optional quantized store. This provider uses the identity mapping between external and internal vector IDs.

§Type Parameters:

  • T: The primitive element type of the full-precision vector. This is typically some type like f32 or half::f16.

  • Q: The full type of the quant vector store. This is not constrained by a trait and rather relies on implementation for several concrete types, including:

    • QuantVectorProvider: A Bf-Tree based spherical quantized vector store.
    • NoStore: Disable quantization altogether. Note that this disables all methods reached through quantization based [Accessor]s at compile-time.

§Indexing Strategies

  • FullPrecision: Only retrieves data from the full-precision portion of the index. No quantized vectors are used. During search, start points are filtered from the final results.

  • Quantized: Performs all operations (search, pruning, insert) entirely in the quantized space using spherical distance functions. Post-processing copies candidate IDs forward without reranking. Fastest option — full-precision vectors are not touched at query time.

§Examples

The following code demonstrates how to instantiate and use the BfTreeProvider in a number of different scenarios.

§Full-Precision Only - No Deletes

This example demonstrates how to create a BfTreeProvider that only supports full-precision vectors.

use diskann_bftree::provider::{
    BfTreeProvider, BfTreeProviderParameters
};
use diskann_bftree::NoStore;
use diskann_vector::distance::Metric;
use diskann_utils::views::{Init, Matrix};
use bf_tree::Config;
use std::num::NonZeroUsize;

let parameters = BfTreeProviderParameters {
    max_points: 5,
    num_start_points: NonZeroUsize::new(1).unwrap(),
    dim: 4,
    metric: Metric::L2,
    max_degree: 32,
    vector_provider_config: Config::default(),
    quant_vector_provider_config: Config::default(),
    neighbor_list_provider_config: Config::default(),
    graph_params: None,
    use_snapshot: false,
};

// Create a table that supports 5 points and 1 start point.
let start_points = Matrix::new(Init(|| 0.0f32), 1, 4);
let provider = BfTreeProvider::<f32, _>::new(
    parameters,
    start_points.as_view(),
    NoStore,
);

§Full-Precision and Spherical Quantization

To create a two-level provider with a spherical quantization-based quant vector store, a Poly<dyn Quantizer> can be supplied for the quant_precursor argument, as this implements the CreateQuantProvider trait.

use diskann_quantization::{
    alloc::{GlobalAllocator, Poly, poly},
    algorithms::TransformKind,
    spherical::{iface, SphericalQuantizer, SupportedMetric, PreScale},
};
use diskann_utils::views::{Init, Matrix};
use diskann_bftree::provider::{
    BfTreeProvider, BfTreeProviderParameters
};
use diskann_vector::distance::Metric;
use bf_tree::Config;
use std::num::NonZeroUsize;
use rand::rngs::StdRng;
use rand::SeedableRng;

let dim = 4;
let data = Matrix::new(Init(|| 1.0f32), 4, dim);
let mut rng = StdRng::seed_from_u64(42);
let sq = SphericalQuantizer::train(
    data.as_view(), TransformKind::Null,
    SupportedMetric::SquaredL2, PreScale::None,
    &mut rng, GlobalAllocator,
).unwrap();
let imp = iface::Impl::<1>::new(sq).unwrap();
let poly = Poly::new(imp, GlobalAllocator).unwrap();
let quantizer: Poly<dyn iface::Quantizer> = poly!(iface::Quantizer, poly);

let parameters = BfTreeProviderParameters {
    max_points: 5,
    num_start_points: NonZeroUsize::new(1).unwrap(),
    dim: 4,
    metric: Metric::L2,
    max_degree: 32,
    vector_provider_config: Config::default(),
    quant_vector_provider_config: Config::default(),
    neighbor_list_provider_config: Config::default(),
    graph_params: None,
    use_snapshot: false,
};

// Create a table that supports 5 points and 1 start point.
let start_points = Matrix::new(Init(|| 0.0f32), 1, 4);
let provider = BfTreeProvider::<f32, _>::new(
    parameters,
    start_points.as_view(),
    quantizer,
);

Implementations§

Source§

impl<T, Q> BfTreeProvider<T, Q>
where T: VectorRepr,

Source

pub fn new<TQ>( params: BfTreeProviderParameters, start_points: MatrixView<'_, T>, quant_precursor: TQ, ) -> ANNResult<Self>
where Self: StartPoint<T>, TQ: CreateQuantProvider<Target = Q>,

Construct a new data provider with start points initialized.

This is the primary constructor for BfTreeProvider where start points are known from the beginning. It creates the provider and sets the start points in one operation.

§Arguments
  • params: An instance of BfTreeProviderParameters collecting shared configuration information.
  • start_points: A matrix view containing the start point vectors. The number of rows must match params.num_start_points.get().
  • quant_precursor: A precursor type for the quantizer layer.
§Type Constraints
  • Self: StartPoint<T> - The provider must implement the StartPoint trait.
Source

pub fn starting_points(&self) -> ANNResult<Vec<u32>>

Return a vector of starting points.

Source

pub fn iter(&self) -> Range<u32>

An iterator over all ids including start points (even if they are deleted).

Source

pub fn num_start_points(&self) -> usize

Source

pub fn max_points(&self) -> usize

Return the maximum number of points (excluding frozen/start points)

Source

pub fn dim(&self) -> usize

Return the vector dimension

Source

pub fn metric(&self) -> Metric

Return the distance metric

Source

pub fn max_degree(&self) -> u32

Return the maximum degree from the neighbor provider

Source§

impl<T> BfTreeProvider<T, QuantVectorProvider>
where T: VectorRepr,

Source

pub fn counts_for_get_vector(&self) -> (usize, usize)

Return the number of vector reads for full-precision and quant-vectors respectively

Source§

impl<T> BfTreeProvider<T, NoStore>
where T: VectorRepr,

Source

pub fn counts_for_get_vector(&self) -> (usize, usize)

Return the number of vector reads for full-precision and quant-vectors respectively

Source§

impl<T, Q> BfTreeProvider<T, Q>

Trait Implementations§

Source§

impl<T, Q> DataProvider for BfTreeProvider<T, Q>

Source§

type Context = DefaultContext

Source§

type InternalId = u32

Source§

type ExternalId = u32

Source§

type Error = ANNError

Source§

type Guard = NoopGuard<u32>

The operation guard returned by SetElement::set_element to notify self if an operation fails. Read more
Source§

fn to_internal_id( &self, _context: &DefaultContext, gid: &Self::ExternalId, ) -> Result<Self::InternalId, Self::Error>

Translate an external id to its corresponding internal id. Read more
Source§

fn to_external_id( &self, _context: &DefaultContext, id: Self::InternalId, ) -> Result<Self::ExternalId, Self::Error>

Translate an internal id to its corresponding external id.
Source§

impl<'a, T, Q> DefaultPostProcessor<'a, BfTreeProvider<T, Q>, &'a [T]> for FullPrecision

Source§

type Processor = Pipeline<FilterStartPoints, CopyIds>

The default post-processor type.
Source§

fn default_post_processor(&self) -> Self::Processor

Create the default post-processor.
Source§

impl<'a, T> DefaultPostProcessor<'a, BfTreeProvider<T>, &'a [T]> for Quantized
where T: VectorRepr,

Source§

type Processor = Pipeline<FilterStartPoints, Rerank>

The default post-processor type.
Source§

fn default_post_processor(&self) -> Self::Processor

Create the default post-processor.
Source§

impl<T, Q> Delete for BfTreeProvider<T, Q>
where T: VectorRepr, Q: AsyncFriendly + DeleteQuant,

Hard-delete implementation for BfTreeProvider.

This provider performs hard deletes: vector data is immediately and irrecoverably erased from the underlying bf-tree storage when Delete::delete is called. When a quantized store is present, both the full-precision and quantized entries are removed.

This has an important consequence for inplace delete: the [InplaceDeleteMethod::VisitedAndTopK] strategy is incompatible with this provider because it requires reading the deleted vector’s data (via InplaceDeleteStrategy::get_delete_element) after the delete has already been committed. Use [InplaceDeleteMethod::OneHop] or [InplaceDeleteMethod::TwoHopAndOneHop] instead, as these strategies only require neighbor topology (which remains accessible).

Source§

fn release( &self, _context: &Self::Context, _id: Self::InternalId, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Release a node by an internal ID. Read more
Source§

fn delete( &self, _context: &Self::Context, gid: &Self::ExternalId, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Delete an item by external ID. Read more
Source§

fn status_by_external_id( &self, context: &Self::Context, gid: &Self::ExternalId, ) -> impl Future<Output = Result<ElementStatus, Self::Error>> + Send

Check the status via external ID.
Source§

fn status_by_internal_id( &self, _context: &Self::Context, id: Self::InternalId, ) -> impl Future<Output = Result<ElementStatus, Self::Error>> + Send

Check the status via internal ID.
Source§

fn statuses_unordered<Itr, F>( &self, context: &Self::Context, itr: Itr, f: F, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where Itr: Iterator<Item = Self::InternalId> + Send, F: FnMut(Result<ElementStatus, Self::Error>, Self::InternalId) + Send,

A potentially optimized bulk version of status_by_internal_id.
Source§

impl<T, Q> HasId for BfTreeProvider<T, Q>

Source§

impl<T, Q> InplaceDeleteStrategy<BfTreeProvider<T, Q>> for FullPrecision

Inplace delete strategy using full-precision vectors.

§Compatibility

This strategy is used with [InplaceDeleteMethod::OneHop] and [InplaceDeleteMethod::TwoHopAndOneHop]. It is not compatible with [InplaceDeleteMethod::VisitedAndTopK] because BfTreeProvider performs hard deletes — the vector data is erased before get_delete_element is called, causing it to fail.

Source§

type DeleteElementError = ANNError

Error type for accessing for search.
Source§

type DeleteElement<'a> = &'a [T]

The type provided to the search portion of inplace-deletion and used to instantiate the required SearchStrategy. Read more
Source§

type DeleteElementGuard = Box<[T]>

The guard type returned by get_delete_element. Read more
Source§

type PruneStrategy = FullPrecision

The pruning strategy to use after the initial search is complete.
Source§

type DeleteSearchAccessor<'a> = FullAccessor<'a, T, Q>

The accessor used during the delete-search phase. Read more
Source§

type SearchPostProcessor = CopyIds

The processor used during the delete-search phase.
Source§

type SearchStrategy = FullPrecision

The type of the search strategy to use for graph traversal.
Source§

fn search_strategy(&self) -> Self::SearchStrategy

Construct the search strategy object.
Source§

fn prune_strategy(&self) -> Self::PruneStrategy

Construct the prune strategy object.
Source§

fn search_post_processor(&self) -> Self::SearchPostProcessor

Construct the search post-processor for the delete-search phase.
Source§

async fn get_delete_element<'a>( &'a self, provider: &'a BfTreeProvider<T, Q>, _context: &'a DefaultContext, id: u32, ) -> Result<Self::DeleteElementGuard, Self::DeleteElementError>

Construct the accessor used to retrieve the item being deleted.
Source§

impl<T> InplaceDeleteStrategy<BfTreeProvider<T>> for Quantized
where T: VectorRepr,

Inplace delete strategy using quantized vectors.

§Compatibility

Same constraint as FullPrecision’s impl: not compatible with [InplaceDeleteMethod::VisitedAndTopK] due to hard deletes.

Source§

type DeleteElementError = ANNError

Error type for accessing for search.
Source§

type DeleteElement<'a> = &'a [T]

The type provided to the search portion of inplace-deletion and used to instantiate the required SearchStrategy. Read more
Source§

type DeleteElementGuard = Box<[T]>

The guard type returned by get_delete_element. Read more
Source§

type PruneStrategy = Quantized

The pruning strategy to use after the initial search is complete.
Source§

type DeleteSearchAccessor<'a> = QuantAccessor<'a, T>

The accessor used during the delete-search phase. Read more
Source§

type SearchPostProcessor = Rerank

The processor used during the delete-search phase.
Source§

type SearchStrategy = Quantized

The type of the search strategy to use for graph traversal.
Source§

fn search_strategy(&self) -> Self::SearchStrategy

Construct the search strategy object.
Source§

fn prune_strategy(&self) -> Self::PruneStrategy

Construct the prune strategy object.
Source§

fn search_post_processor(&self) -> Self::SearchPostProcessor

Construct the search post-processor for the delete-search phase.
Source§

async fn get_delete_element<'a>( &'a self, provider: &'a BfTreeProvider<T, QuantVectorProvider>, _context: &'a DefaultContext, id: u32, ) -> Result<Self::DeleteElementGuard, Self::DeleteElementError>

Construct the accessor used to retrieve the item being deleted.
Source§

impl<'a, T, Q> InsertStrategy<'a, BfTreeProvider<T, Q>, &'a [T]> for FullPrecision

Source§

type PruneStrategy = FullPrecision

The pruning strategy associated with the insertion strategy.
Source§

fn prune_strategy(&self) -> Self::PruneStrategy

Return the prune strategy used for insertion.
Source§

fn insert_search_accessor( &'a self, provider: &'a Provider, context: &'a <Provider as DataProvider>::Context, vector: T, ) -> Result<Self::SearchAccessor, Self::SearchAccessorError>

This API is invoked during inserts to create the associated SearchAccessor. Read more
Source§

impl<'a, T> InsertStrategy<'a, BfTreeProvider<T>, &'a [T]> for Quantized
where T: VectorRepr,

Source§

type PruneStrategy = Quantized

The pruning strategy associated with the insertion strategy.
Source§

fn prune_strategy(&self) -> Self::PruneStrategy

Return the prune strategy used for insertion.
Source§

fn insert_search_accessor( &'a self, provider: &'a Provider, context: &'a <Provider as DataProvider>::Context, vector: T, ) -> Result<Self::SearchAccessor, Self::SearchAccessorError>

This API is invoked during inserts to create the associated SearchAccessor. Read more
Source§

impl<T, Q> IntoIterator for &BfTreeProvider<T, Q>
where T: VectorRepr,

Allow &BfTreeProvider to implement IntoIter

Source§

type Item = u32

The type of the elements being iterated over.
Source§

type IntoIter = Range<u32>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> LoadWith<String> for BfTreeProvider<T, NoStore>
where T: VectorRepr,

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>(storage: &P, prefix: &String) -> Result<Self, Self::Error>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<T> LoadWith<String> for BfTreeProvider<T, QuantVectorProvider>
where T: VectorRepr,

Source§

type Error = ANNError

The error type if deserialization is unsuccessful.
Source§

async fn load_with<P>(storage: &P, prefix: &String) -> Result<Self, Self::Error>

Load self form disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<T, Q, B> MultiInsertStrategy<BfTreeProvider<T, Q>, B> for FullPrecision
where T: VectorRepr, Q: AsyncFriendly, B: for<'a> Batch<Element<'a> = &'a [T]> + Debug,

Source§

type Seed = Builder<u32, Ref<[T]>>

The prune-accessor “seed”, potentially containing B for faster access.
Source§

type FinishError = Infallible

Any critical error that occurs during finish.
Source§

type PruneStrategy = FullPrecision

The delegated PruneStrategy used for pruning.
Source§

type InsertStrategy = FullPrecision

The delegated InsertStrategy for most insertion related decisions.
Source§

fn insert_strategy(&self) -> Self::InsertStrategy

Construct the associated InsertStrategy.
Source§

fn finish<Itr>( &self, _provider: &BfTreeProvider<T, Q>, _ctx: &DefaultContext, batch: &Arc<B>, ids: Itr, ) -> impl Future<Output = Result<Self::Seed, Self::FinishError>> + Send
where Itr: ExactSizeIterator<Item = u32> + Send,

Package batch and the associated internal IDs into an intermediate seed. Read more
Source§

fn seeded_prune_accessor<'a>( &'a self, provider: &'a BfTreeProvider<T, Q>, _context: &'a DefaultContext, seed: &'a Self::Seed, capacity: usize, ) -> ANNResult<FullPruneAccessor<'a, T, Q>>

Construct a PruneAccessor from a seed returned by Self::finish. Read more
Source§

impl<T, B> MultiInsertStrategy<BfTreeProvider<T>, B> for Quantized
where T: VectorRepr, B: Batch + for<'a> Batch<Element<'a> = &'a [T]> + Debug,

Source§

type Seed = ()

The prune-accessor “seed”, potentially containing B for faster access.
Source§

type FinishError = Infallible

Any critical error that occurs during finish.
Source§

type PruneStrategy = Quantized

The delegated PruneStrategy used for pruning.
Source§

type InsertStrategy = Quantized

The delegated InsertStrategy for most insertion related decisions.
Source§

fn insert_strategy(&self) -> Self::InsertStrategy

Construct the associated InsertStrategy.
Source§

fn finish<Itr>( &self, _provider: &BfTreeProvider<T, QuantVectorProvider>, _ctx: &DefaultContext, _batch: &Arc<B>, _ids: Itr, ) -> impl Future<Output = Result<Self::Seed, Self::FinishError>> + Send
where Itr: ExactSizeIterator<Item = u32> + Send,

Package batch and the associated internal IDs into an intermediate seed. Read more
Source§

fn seeded_prune_accessor<'a>( &'a self, provider: &'a BfTreeProvider<T, QuantVectorProvider>, _context: &'a DefaultContext, _seed: &'a (), capacity: usize, ) -> ANNResult<QuantPruneAccessor<'a, T>>

Construct a PruneAccessor from a seed returned by Self::finish. Read more
Source§

impl<T, Q> PruneStrategy<BfTreeProvider<T, Q>> for FullPrecision

Source§

type PruneAccessor<'a> = FullPruneAccessor<'a, T, Q>

The concrete type of the PruneAccessor that is used during index construction.
Source§

type PruneAccessorError = Infallible

An error that can occur when getting the prune accessor.
Source§

fn prune_accessor<'a>( &'a self, provider: &'a BfTreeProvider<T, Q>, _context: &'a DefaultContext, capacity: usize, ) -> Result<Self::PruneAccessor<'a>, Self::PruneAccessorError>

Return the PruneAccessor. Argument capacity provides an upper bound on the length of the iterator passed to PruneAccessor::fill.
Source§

impl<T> PruneStrategy<BfTreeProvider<T>> for Quantized
where T: VectorRepr,

Source§

type PruneAccessor<'a> = QuantPruneAccessor<'a, T>

The concrete type of the PruneAccessor that is used during index construction.
Source§

type PruneAccessorError = ANNError

An error that can occur when getting the prune accessor.
Source§

fn prune_accessor<'a>( &'a self, provider: &'a BfTreeProvider<T, QuantVectorProvider>, _context: &'a DefaultContext, capacity: usize, ) -> Result<Self::PruneAccessor<'a>, Self::PruneAccessorError>

Return the PruneAccessor. Argument capacity provides an upper bound on the length of the iterator passed to PruneAccessor::fill.
Source§

impl<T> SaveWith<String> for BfTreeProvider<T, NoStore>
where T: VectorRepr,

Source§

type Ok = usize

The return type upon successful saving. This is often (but is not required to be) the number of bytes written to disk.
Source§

type Error = ANNError

The error type if serialization is unsuccessful.
Source§

async fn save_with<P>( &self, storage: &P, prefix: &String, ) -> Result<Self::Ok, Self::Error>

Safe self to disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<T> SaveWith<String> for BfTreeProvider<T, QuantVectorProvider>
where T: VectorRepr,

Source§

type Ok = usize

The return type upon successful saving. This is often (but is not required to be) the number of bytes written to disk.
Source§

type Error = ANNError

The error type if serialization is unsuccessful.
Source§

async fn save_with<P>( &self, storage: &P, prefix: &String, ) -> Result<Self::Ok, Self::Error>

Safe self to disk using provider for IO-related needs. Argument auxiliary can be arbitrary metadata required for a successful operation, such as file paths.
Source§

impl<'a, T, Q> SearchStrategy<'a, BfTreeProvider<T, Q>, &'a [T]> for FullPrecision

Perform a search entirely in the full-precision space.

Starting points are not filtered out of the final results.

Source§

type SearchAccessor = FullAccessor<'a, T, Q>

The concrete type of the accessor that is used to access Self during the greedy graph search. The query will be provided to the accessor exactly once during search to construct the query computer.
Source§

type SearchAccessorError = Infallible

An error that can occur when getting a search_accessor.
Source§

fn search_accessor( &'a self, provider: &'a BfTreeProvider<T, Q>, _context: &'a DefaultContext, query: &'a [T], ) -> Result<Self::SearchAccessor, Self::SearchAccessorError>

Construct and return the search accessor.
Source§

impl<'a, T> SearchStrategy<'a, BfTreeProvider<T>, &'a [T]> for Quantized
where T: VectorRepr,

Perform a search entirely in the quantized space.

Starting points are not filtered out of the final results.

Source§

type SearchAccessor = QuantAccessor<'a, T>

The concrete type of the accessor that is used to access Self during the greedy graph search. The query will be provided to the accessor exactly once during search to construct the query computer.
Source§

type SearchAccessorError = ANNError

An error that can occur when getting a search_accessor.
Source§

fn search_accessor( &'a self, provider: &'a BfTreeProvider<T, QuantVectorProvider>, _context: &'a DefaultContext, query: &'a [T], ) -> Result<Self::SearchAccessor, Self::SearchAccessorError>

Construct and return the search accessor.
Source§

impl<T> SetElement<&[T]> for BfTreeProvider<T, QuantVectorProvider>
where T: VectorRepr,

Assign to both the full-precision and quant vector stores

Source§

fn set_element( &self, _context: &Self::Context, id: &u32, element: &[T], ) -> impl Future<Output = Result<Self::Guard, Self::SetError>> + Send

Store the provided element in both the full-precision and quant vector stores.

Full-precision is written first as the authoritative store. This ensures that if the quant write fails, the worst case is a vector reachable in full-precision but not yet in quantized search (benign), rather than a quantized ghost with no full-precision backing data.

Source§

type SetError = ANNError

The kind of error yielded by set_element.
Source§

impl<T> SetElement<&[T]> for BfTreeProvider<T, NoStore>
where T: VectorRepr,

Assign to just the full-precision store

Source§

fn set_element( &self, _context: &Self::Context, id: &u32, element: &[T], ) -> impl Future<Output = Result<Self::Guard, Self::SetError>> + Send

Store the provided element in just the full-precision vector stores

Source§

type SetError = ANNError

The kind of error yielded by set_element.
Source§

impl<T> StartPoint<T> for BfTreeProvider<T, QuantVectorProvider>
where T: VectorRepr,

Set start points for the BfTreeProvider with quantization.

This implementation sets both the full-precision and quantized vectors for each start point, as well as initializing empty neighbor lists.

Source§

impl<T> StartPoint<T> for BfTreeProvider<T, NoStore>
where T: VectorRepr,

Set start points for the BfTreeProvider without quantization.

This implementation sets the full-precision vectors for each start point and initializes empty neighbor lists.

Auto Trait Implementations§

§

impl<T, Q = QuantVectorProvider> !Freeze for BfTreeProvider<T, Q>

§

impl<T, Q = QuantVectorProvider> !RefUnwindSafe for BfTreeProvider<T, Q>

§

impl<T, Q = QuantVectorProvider> !UnwindSafe for BfTreeProvider<T, Q>

§

impl<T, Q> Send for BfTreeProvider<T, Q>
where Q: Send,

§

impl<T, Q> Sync for BfTreeProvider<T, Q>
where Q: Sync,

§

impl<T, Q> Unpin for BfTreeProvider<T, Q>
where Q: Unpin, T: Unpin,

§

impl<T, Q> UnsafeUnpin for BfTreeProvider<T, Q>
where Q: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncFriendly for T
where T: Send + Sync + 'static,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more