Skip to main content

Scanner

Struct Scanner 

Source
pub struct Scanner { /* private fields */ }
Expand description

Dataset Scanner

let dataset = Dataset::open(uri).await.unwrap();
let stream = dataset.scan()
    .project(&["col", "col2.subfield"]).unwrap()
    .limit(10)
    .into_stream();
stream
  .map(|batch| batch.num_rows())
  .buffered(16)
  .sum()

Implementations§

Source§

impl Scanner

Source

pub fn new(dataset: Arc<Dataset>) -> Self

Source

pub fn blob_handling(&mut self, blob_handling: BlobHandling) -> &mut Self

Source

pub fn from_fragment(dataset: Arc<Dataset>, fragment: Fragment) -> Self

Source

pub fn with_fragments(&mut self, fragments: Vec<Fragment>) -> &mut Self

Set which fragments should be scanned.

If scan_in_order is set to true, the fragments will be scanned in the order of the vector.

Source

pub fn empty_project(&mut self) -> Result<&mut Self>

Empty Projection (useful for count queries)

The row_address will be scanned (no I/O required) but not included in the output

Source

pub fn project<T: AsRef<str>>(&mut self, columns: &[T]) -> Result<&mut Self>

Projection.

Only select the specified columns. If not specified, all columns will be scanned.

Source

pub fn project_with_transform( &mut self, columns: &[(impl AsRef<str>, impl AsRef<str>)], ) -> Result<&mut Self>

Projection with transform

Only select the specified columns with the given transform.

Source

pub fn prefilter(&mut self, should_prefilter: bool) -> &mut Self

Should the filter run before the vector index is applied

If true then the filter will be applied before the vector index. This means the results will be accurate but the overall query may be more expensive.

If false then the filter will be applied to the nearest results. This means you may get back fewer results than you ask for (or none at all) if the closest results do not match the filter.

Source

pub fn scan_stats_callback( &mut self, callback: ExecutionStatsCallback, ) -> &mut Self

Set the callback to be called after the scan with summary statistics

Source

pub fn materialization_style( &mut self, style: MaterializationStyle, ) -> &mut Self

Set the materialization style for the scan

This controls when columns are fetched from storage. The default should work well for most cases.

If you know (in advance) a query will return relatively few results (less than 0.1% of the rows) then you may want to experiment with applying late materialization to more (or all) columns.

If you know a query is going to return many rows then you may want to experiment with applying early materialization to more (or all) columns.

Source

pub fn filter(&mut self, filter: &str) -> Result<&mut Self>

Apply filters

The filters can be presented as the string, as in WHERE clause in SQL.

let dataset = Dataset::open(uri).await.unwrap();
let stream = dataset.scan()
    .project(&["col", "col2.subfield"]).unwrap()
    .filter("a > 10 AND b < 200").unwrap()
    .limit(10)
    .into_stream();

Once the filter is applied, Lance will create an optimized I/O plan for filtering.

Source

pub fn filter_query(&mut self, filter: QueryFilter) -> Result<&mut Self>

Apply fts/vector query as filter.

  • Vector query filter can only be applied to full text search.
  • Fts query filter can only be applied to vector search.
  • Query filter couldn’t be applied to normal query.
let dataset = Dataset::open(uri).await.unwrap();
let query_vector = Float32Array::from(vec![300f32, 300f32, 300f32, 300f32]);
let stream = dataset.scan()
    .nearest("vector", &query_vector, 5)
    .project(&["col", "col2.subfield"]).unwrap()
    .query_filter(QueryFilter::Fts(FullTextSearchQuery::new(
      "hello".to_string(),
    ))).unwrap()
    .limit(10)
    .into_stream();

Filter by full text search The column must be a string column. The query is a string to search for. The search is case-insensitive, BM25 scoring is used.

let dataset = Dataset::open(uri).await.unwrap();
let stream = dataset.scan()
   .project(&["col", "col2.subfield"]).unwrap()
   .full_text_search("col", "query").unwrap()
   .limit(10)
   .into_stream();
Source

pub fn filter_substrait(&mut self, filter: &[u8]) -> Result<&mut Self>

Set a filter using a Substrait ExtendedExpression message

The message must contain exactly one expression and that expression must be a scalar expression whose return type is boolean.

Source

pub fn filter_expr(&mut self, filter: Expr) -> &mut Self

Source

pub fn aggregate(&mut self, aggregate: AggregateExpr) -> Result<&mut Self>

Set aggregation.

The aggregate expression is parsed immediately using the dataset schema. For Substrait aggregates, this converts them to DataFusion expressions.

Source

pub fn batch_size(&mut self, batch_size: usize) -> &mut Self

Set the batch size.

Source

pub fn include_deleted_rows(&mut self) -> &mut Self

Include deleted rows

These are rows that have been deleted from the dataset but are still present in the underlying storage. These rows will have the _rowid column set to NULL. The other columns (include _rowaddr) will be set to their deleted values.

This can be useful for generating aligned fragments or debugging

Note: when entire fragments are deleted, the scanner will not emit any rows for that fragment since the fragment is no longer present in the dataset.

Source

pub fn io_buffer_size(&mut self, size: u64) -> &mut Self

Set the I/O buffer size

This is the amount of RAM that will be reserved for holding I/O received from storage before it is processed. This is used to control the amount of memory used by the scanner. If the buffer is full then the scanner will block until the buffer is processed.

Generally this should scale with the number of concurrent I/O threads. The default is 2GiB which comfortably provides enough space for somewhere between 32 and 256 concurrent I/O threads.

This value is not a hard cap on the amount of RAM the scanner will use. Some space is used for the compute (which can be controlled by the batch size) and Lance does not keep track of memory after it is returned to the user.

Currently, if there is a single batch of data which is larger than the io buffer size then the scanner will deadlock. This is a known issue and will be fixed in a future release.

Source

pub fn batch_readahead(&mut self, nbatches: usize) -> &mut Self

Set the prefetch size. Ignored in v2 and newer format

Source

pub fn fragment_readahead(&mut self, nfragments: usize) -> &mut Self

Set the fragment readahead.

This is only used if scan_in_order is set to false.

Source

pub fn scan_in_order(&mut self, ordered: bool) -> &mut Self

Set whether to read data in order (default: true)

A scan will always read from the disk concurrently. If this property is true then a ready batch (a batch that has been read from disk) will only be returned if it is the next batch in the sequence. Otherwise, the batch will be held until the stream catches up. This means the sequence is returned in order but there may be slightly less parallelism.

If this is false, then batches will be returned as soon as they are available, potentially increasing throughput slightly

If an ordering is defined (using Self::order_by) then the scan will always scan in parallel and any value set here will be ignored.

Source

pub fn use_scalar_index(&mut self, use_scalar_index: bool) -> &mut Self

Set whether to use scalar index.

By default, scalar indices will be used to optimize a query if available. However, in some corner cases, scalar indices may not be the best choice. This option allows users to disable scalar indices for a query.

Source

pub fn strict_batch_size(&mut self, strict_batch_size: bool) -> &mut Self

Set whether to use strict batch size.

If this is true then output batches (except the last batch) will have exactly batch_size rows. By default, this is False and output batches are allowed to have fewer than batch_size rows Setting this to True will require us to merge batches, incurring a data copy, for a minor performance penalty.

Source

pub fn limit( &mut self, limit: Option<i64>, offset: Option<i64>, ) -> Result<&mut Self>

Set limit and offset.

If offset is set, the first offset rows will be skipped. If limit is set, only the provided number of rows will be returned. These can be set independently. For example, setting offset to 10 and limit to None will skip the first 10 rows and return the rest of the rows in the dataset.

Source

pub fn nearest( &mut self, column: &str, q: &dyn Array, k: usize, ) -> Result<&mut Self>

Find k-nearest neighbor within the vector column. the query can be a Float16Array, Float32Array, Float64Array, UInt8Array, or a ListArray/FixedSizeListArray of the above types.

Source

pub fn distance_range( &mut self, lower_bound: Option<f32>, upper_bound: Option<f32>, ) -> &mut Self

Set the distance thresholds for the nearest neighbor search.

Source

pub fn nprobes(&mut self, n: usize) -> &mut Self

Configures how many partititions will be searched in the vector index.

This method is a convenience method that sets both Self::minimum_nprobes and Self::maximum_nprobes to the same value.

Source

pub fn nprobs(&mut self, n: usize) -> &mut Self

👎Deprecated:

Use nprobes instead

Configures how many partititions will be searched in the vector index.

This method is a convenience method that sets both Self::minimum_nprobes and Self::maximum_nprobes to the same value.

Source

pub fn minimum_nprobes(&mut self, n: usize) -> &mut Self

Configures the minimum number of partitions to search in the vector index.

If we have found k matching results after searching this many partitions then the search will stop. Increasing this number can increase recall but will increase latency on all queries.

The default value is 1.

Source

pub fn maximum_nprobes(&mut self, n: usize) -> &mut Self

Configures the maximum number of partitions to search in the vector index.

These partitions will only be searched if we have not found k results after searching the minimum number of partitions. Setting this to None (the default) will search all partitions if needed.

This setting only takes effect when a prefilter is in place. In that case we can spend more effort to try and find results when the filter is highly selective.

If there is no prefilter, or the results are not highly selective, this value will have no effect.

Source

pub fn ef(&mut self, ef: usize) -> &mut Self

Only search the data being indexed.

Default value is false.

This is essentially a weak consistency search, only on the indexed data.

Source

pub fn refine(&mut self, factor: u32) -> &mut Self

Apply a refine step to the vector search.

A refine improves query accuracy but also makes search slower, by reading extra elements and using the original vector values to re-rank the distances.

  • factor - the factor of extra elements to read. For example, if factor is 2, then the search will read 2x more elements than the requested k before performing the re-ranking. Note: even if the factor is 1, the results will still be re-ranked without fetching additional elements.
Source

pub fn distance_metric(&mut self, metric_type: MetricType) -> &mut Self

Change the distance MetricType, i.e, L2 or Cosine distance.

Source

pub fn order_by( &mut self, ordering: Option<Vec<ColumnOrdering>>, ) -> Result<&mut Self>

Sort the results of the scan by one or more columns

If Some, then the resulting stream will be sorted according to the given ordering. This may increase the latency of the first result since all data must be read before the first batch can be returned.

Source

pub fn use_index(&mut self, use_index: bool) -> &mut Self

Set whether to use the index if available

Source

pub fn with_row_id(&mut self) -> &mut Self

Instruct the scanner to return the _rowid meta column from the dataset.

Source

pub fn with_row_address(&mut self) -> &mut Self

Instruct the scanner to return the _rowaddr meta column from the dataset.

Source

pub fn disable_scoring_autoprojection(&mut self) -> &mut Self

Instruct the scanner to disable automatic projection of scoring columns

In the future, this will be the default behavior. This method is useful for opting in to the new behavior early to avoid breaking changes (and a warning message)

Once the default switches, the old autoprojection behavior will be removed.

The autoprojection behavior (current default) includes the _score or _distance column even if a projection is manually specified with [project] or [project_with_transform].

The new behavior will only include the _score or _distance column if no projection is specified or if the user explicitly includes the _score or _distance column in the projection.

Source

pub fn with_file_reader_options( &mut self, options: FileReaderOptions, ) -> &mut Self

Set the file reader options to use when reading data files.

Source

pub fn use_stats(&mut self, use_stats: bool) -> &mut Self

Set whether to use statistics to optimize the scan (default: true)

This is used for debugging or benchmarking purposes.

Source

pub async fn schema(&self) -> Result<SchemaRef>

The Arrow schema of the output, including projections and vector / _distance

Source

pub fn get_expr_filter(&self) -> Result<Option<Expr>>

Fetches the currently set expr filter

Note that this forces the filter to be evaluated and the result will depend on the current state of the scanner (e.g. if with_row_id has been called then _rowid will be available for filtering but not otherwise) and so you may want to call this after setting all other options.

Source

pub fn try_into_stream(&self) -> BoxFuture<'_, Result<DatasetRecordBatchStream>>

Create a stream from the Scanner.

Source

pub async fn try_into_batch(&self) -> Result<RecordBatch>

Source

pub fn count_rows(&self) -> BoxFuture<'_, Result<u64>>

Scan and return the number of matching rows

Note: calling Dataset::count_rows can be more efficient than calling this method especially if there is no filter.

Source

pub fn create_aggregate_plan( &self, ) -> BoxFuture<'_, Result<Arc<dyn ExecutionPlan>>>

👎Deprecated:

Use create_plan() instead, which now applies aggregate automatically

Create an execution plan with aggregation.

Requires aggregate() to be called first.

Source

pub async fn create_plan(&self) -> Result<Arc<dyn ExecutionPlan>>

Create ExecutionPlan for Scan.

An ExecutionPlan is a graph of operators that can be executed.

The following plans are supported:

  • Plain scan without filter or limits.
Scan(projections)
  • Scan with filter and/or limits.
Scan(filtered_cols) -> Filter(expr)
   -> (*LimitExec(limit, offset))
   -> Take(remaining_cols) -> Projection()
  • Use KNN Index (with filter and/or limits)
KNNIndex() -> Take(vector) -> FlatRefine()
    -> Take(filtered_cols) -> Filter(expr)
    -> (*LimitExec(limit, offset))
    -> Take(remaining_cols) -> Projection()
  • Use KNN flat (brute force) with filter and/or limits
Scan(vector) -> FlatKNN()
    -> Take(filtered_cols) -> Filter(expr)
    -> (*LimitExec(limit, offset))
    -> Take(remaining_cols) -> Projection()

In general, a plan has 5 stages:

  1. Source (from dataset Scan or from index, may include prefilter)
  2. Filter
  3. Sort
  4. Limit / Offset
  5. Take remaining columns / Projection
Source

pub async fn analyze_plan(&self) -> Result<String>

Source

pub async fn explain_plan(&self, verbose: bool) -> Result<String>

Trait Implementations§

Source§

impl Clone for Scanner

Source§

fn clone(&self) -> Scanner

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

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> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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