pub struct Table { /* private fields */ }
Expand description
A Table is a collection of strong typed Rows.
The type of the each row is defined in Apache Arrow Schema.
Implementations§
Source§impl Table
impl Table
pub fn new(inner: Arc<dyn BaseTable>) -> Self
pub fn base_table(&self) -> &Arc<dyn BaseTable>
Sourcepub fn as_native(&self) -> Option<&NativeTable>
pub fn as_native(&self) -> Option<&NativeTable>
Cast as NativeTable
, or return None it if is not a NativeTable
.
Warning: This function will be removed soon (features exclusive to NativeTable will be added to Table)
Sourcepub fn dataset(&self) -> Option<&DatasetConsistencyWrapper>
pub fn dataset(&self) -> Option<&DatasetConsistencyWrapper>
Get the dataset of the table if it is a native table
Returns None otherwise
Sourcepub async fn count_rows(&self, filter: Option<String>) -> Result<usize>
pub async fn count_rows(&self, filter: Option<String>) -> Result<usize>
Count the number of rows in this dataset.
§Arguments
filter
if present, only count rows matching the filter
Sourcepub fn add<T: IntoArrow>(&self, batches: T) -> AddDataBuilder<T>
pub fn add<T: IntoArrow>(&self, batches: T) -> AddDataBuilder<T>
Insert new records into this Table
§Arguments
batches
data to be added to the Tableoptions
options to control how data is added
Sourcepub fn update(&self) -> UpdateBuilder
pub fn update(&self) -> UpdateBuilder
Update existing records in the Table
An update operation can be used to adjust existing values. Use the returned builder to specify which columns to update. The new value can be a literal value (e.g. replacing nulls with some default value) or an expression applied to the old value (e.g. incrementing a value)
An optional condition can be specified (e.g. “only update if the old value is 0”)
Note: if your condition is something like “some_id_column == 7” and
you are updating many rows (with different ids) then you will get
better performance with a single [merge_insert
] call instead of
repeatedly calilng this method.
Sourcepub async fn delete(&self, predicate: &str) -> Result<DeleteResult>
pub async fn delete(&self, predicate: &str) -> Result<DeleteResult>
Delete the rows from table that match the predicate.
§Arguments
predicate
- The SQL predicate string to filter the rows to be deleted.
§Example
let tmpdir = tempfile::tempdir().unwrap();
let db = lancedb::connect(tmpdir.path().to_str().unwrap())
.execute()
.await
.unwrap();
let batches = RecordBatchIterator::new(
vec![RecordBatch::try_new(
schema.clone(),
vec![
Arc::new(Int32Array::from_iter_values(0..10)),
Arc::new(
FixedSizeListArray::from_iter_primitive::<Float32Type, _, _>(
(0..10).map(|_| Some(vec![Some(1.0); 128])),
128,
),
),
],
)
.unwrap()]
.into_iter()
.map(Ok),
schema.clone(),
);
let tbl = db
.create_table("delete_test", Box::new(batches))
.execute()
.await
.unwrap();
tbl.delete("id > 5").await.unwrap();
Sourcepub fn create_index(
&self,
columns: &[impl AsRef<str>],
index: Index,
) -> IndexBuilder
pub fn create_index( &self, columns: &[impl AsRef<str>], index: Index, ) -> IndexBuilder
Create an index on the provided column(s).
Indices are used to speed up searches and are often needed when the size of the table becomes large (the exact size depends on many factors but somewhere between 100K rows and 1M rows is a good rule of thumb)
There are a variety of indices available. They are described more in
crate::index::Index
. The simplest thing to do is to use index::Index::Auto
which
will attempt to create the most useful index based on the column type and column
statistics. BTree
index is created by default for numeric, temporal, and
string columns.
Once an index is created it will remain until the data is overwritten (e.g. an add operation with mode overwrite) or the indexed column is dropped.
Indices are not automatically updated with new data. If you add new data to the table then the index will not include the new rows. However, a table search will still consider the unindexed rows. Searches will issue both an indexed search (on the data covered by the index) and a flat search (on the unindexed data) and the results will be combined.
If there is enough unindexed data then the flat search will become slow and the index should be optimized. Optimizing an index will add any unindexed data to the existing index without rerunning the full index creation process. For more details see Table::optimize.
Note: Multi-column (composite) indices are not currently supported. However, they will be supported in the future and the API is designed to be compatible with them.
§Examples
use lancedb::index::Index;
let tmpdir = tempfile::tempdir().unwrap();
let db = lancedb::connect(tmpdir.path().to_str().unwrap())
.execute()
.await
.unwrap();
// Create IVF PQ index on the "vector" column by default.
tbl.create_index(&["vector"], Index::Auto)
.execute()
.await
.unwrap();
// Create a BTree index on the "id" column.
tbl.create_index(&["id"], Index::Auto)
.execute()
.await
.unwrap();
// Create a LabelList index on the "tags" column.
tbl.create_index(&["tags"], Index::LabelList(Default::default()))
.execute()
.await
.unwrap();
Sourcepub fn create_index_with_timeout(
&self,
columns: &[impl AsRef<str>],
index: Index,
wait_timeout: Option<Duration>,
) -> IndexBuilder
pub fn create_index_with_timeout( &self, columns: &[impl AsRef<str>], index: Index, wait_timeout: Option<Duration>, ) -> IndexBuilder
See Table::create_index For remote tables, this allows an optional wait_timeout to poll until asynchronous indexing is complete
Sourcepub fn merge_insert(&self, on: &[&str]) -> MergeInsertBuilder
pub fn merge_insert(&self, on: &[&str]) -> MergeInsertBuilder
Create a builder for a merge insert operation
This operation can add rows, update rows, and remove rows all in a single transaction. It is a very generic tool that can be used to create behaviors like “insert if not exists”, “update or insert (i.e. upsert)”, or even replace a portion of existing data with new data (e.g. replace all data where month=“january”)
The merge insert operation works by combining new data from a source table with existing data in a target table by using a join. There are three categories of records.
“Matched” records are records that exist in both the source table and the target table. “Not matched” records exist only in the source table (e.g. these are new data) “Not matched by source” records exist only in the target table (this is old data)
The builder returned by this method can be used to customize what should happen for each category of data.
Please note that the data may appear to be reordered as part of this operation. This is because updated rows will be deleted from the dataset and then reinserted at the end with the new values.
§Arguments
on
One or more columns to join on. This is how records from the source table and target table are matched. Typically this is some kind of key or id column.
§Examples
let tmpdir = tempfile::tempdir().unwrap();
let db = lancedb::connect(tmpdir.path().to_str().unwrap())
.execute()
.await
.unwrap();
let new_data = RecordBatchIterator::new(
vec![RecordBatch::try_new(
schema.clone(),
vec![
Arc::new(Int32Array::from_iter_values(0..10)),
Arc::new(
FixedSizeListArray::from_iter_primitive::<Float32Type, _, _>(
(0..10).map(|_| Some(vec![Some(1.0); 128])),
128,
),
),
],
)
.unwrap()]
.into_iter()
.map(Ok),
schema.clone(),
);
// Perform an upsert operation
let mut merge_insert = tbl.merge_insert(&["id"]);
merge_insert
.when_matched_update_all(None)
.when_not_matched_insert_all();
merge_insert.execute(Box::new(new_data)).await.unwrap();
Sourcepub fn query(&self) -> Query
pub fn query(&self) -> Query
Create a Query
Builder.
Queries allow you to search your existing data. By default the query will return all the data in the table in no particular order. The builder returned by this method can be used to control the query using filtering, vector similarity, sorting, and more.
Note: By default, all columns are returned. For best performance, you should
only fetch the columns you need. See [Query::select_with_projection
] for
more details.
When appropriate, various indices and statistics will be used to accelerate the query.
§Examples
§Vector search
This example will find the 10 rows whose value in the “vector” column are closest to the query vector [1.0, 2.0, 3.0]. If an index has been created on the “vector” column then this will perform an ANN search.
The [Query::refine_factor
] and [Query::nprobes
] methods are used to
control the recall / latency tradeoff of the search.
use crate::lancedb::Table;
use crate::lancedb::query::ExecutableQuery;
let stream = tbl
.query()
.nearest_to(&[1.0, 2.0, 3.0])
.unwrap()
.refine_factor(5)
.nprobes(10)
.execute()
.await
.unwrap();
let batches: Vec<RecordBatch> = stream.try_collect().await.unwrap();
§SQL-style filter
This query will return up to 1000 rows whose value in the id
column
is greater than 5. LanceDb supports a broad set of filtering functions.
use crate::lancedb::Table;
use crate::lancedb::query::{ExecutableQuery, QueryBase};
let stream = tbl
.query()
.only_if("id > 5")
.limit(1000)
.execute()
.await
.unwrap();
let batches: Vec<RecordBatch> = stream.try_collect().await.unwrap();
§Full scan
This query will return everything in the table in no particular order.
use crate::lancedb::Table;
use crate::lancedb::query::ExecutableQuery;
let stream = tbl.query().execute().await.unwrap();
let batches: Vec<RecordBatch> = stream.try_collect().await.unwrap();
Sourcepub fn vector_search(&self, query: impl IntoQueryVector) -> Result<VectorQuery>
pub fn vector_search(&self, query: impl IntoQueryVector) -> Result<VectorQuery>
Search the table with a given query vector.
This is a convenience method for preparing a vector query and
is the same thing as calling nearest_to
on the builder returned
by query
. See Query::nearest_to
for more details.
Sourcepub async fn optimize(&self, action: OptimizeAction) -> Result<OptimizeStats>
pub async fn optimize(&self, action: OptimizeAction) -> Result<OptimizeStats>
Optimize the on-disk data and indices for better performance.
Modeled after VACUUM
in PostgreSQL.
Optimization is discussed in more detail in the OptimizeAction documentation and covers three operations:
- Compaction: Merges small files into larger ones
- Prune: Removes old versions of the dataset
- Index: Optimizes the indices, adding new data to existing indices
The optimization process is undergoing active development and may change. Our goal with these changes is to improve the performance of optimization and reduce the complexity.
That being said, it is essential today to run optimize if you want the best performance. It should be stable and safe to use in production, but it our hope that the API may be simplified (or not even need to be called) in the future.
The frequency an application shoudl call optimize is based on the frequency of data modifications. If data is frequently added, deleted, or updated then optimize should be run frequently. A good rule of thumb is to run optimize if you have added or modified 100,000 or more records or run more than 20 data modification operations.
Sourcepub async fn add_columns(
&self,
transforms: NewColumnTransform,
read_columns: Option<Vec<String>>,
) -> Result<AddColumnsResult>
pub async fn add_columns( &self, transforms: NewColumnTransform, read_columns: Option<Vec<String>>, ) -> Result<AddColumnsResult>
Add new columns to the table, providing values to fill in.
Sourcepub async fn alter_columns(
&self,
alterations: &[ColumnAlteration],
) -> Result<AlterColumnsResult>
pub async fn alter_columns( &self, alterations: &[ColumnAlteration], ) -> Result<AlterColumnsResult>
Change a column’s name or nullability.
Sourcepub async fn drop_columns(&self, columns: &[&str]) -> Result<DropColumnsResult>
pub async fn drop_columns(&self, columns: &[&str]) -> Result<DropColumnsResult>
Remove columns from the table.
Sourcepub async fn version(&self) -> Result<u64>
pub async fn version(&self) -> Result<u64>
Retrieve the version of the table
LanceDb supports versioning. Every operation that modifies the table increases
version. As long as a version hasn’t been deleted you can [Self::checkout]
that
version to view the data at that point. In addition, you can [Self::restore]
the
version to replace the current table with a previous version.
Sourcepub async fn checkout(&self, version: u64) -> Result<()>
pub async fn checkout(&self, version: u64) -> Result<()>
Checks out a specific version of the Table
Any read operation on the table will now access the data at the checked out version. As a consequence, calling this method will disable any read consistency interval that was previously set.
This is a read-only operation that turns the table into a sort of “view”
or “detached head”. Other table instances will not be affected. To make the change
permanent you can use the [Self::restore]
method.
Any operation that modifies the table will fail while the table is in a checked out state.
To return the table to a normal state use [Self::checkout_latest]
Sourcepub async fn checkout_tag(&self, tag: &str) -> Result<()>
pub async fn checkout_tag(&self, tag: &str) -> Result<()>
Checks out a specific version of the Table by tag
Any read operation on the table will now access the data at the version referenced by the tag. As a consequence, calling this method will disable any read consistency interval that was previously set.
This is a read-only operation that turns the table into a sort of “view”
or “detached head”. Other table instances will not be affected. To make the change
permanent you can use the [Self::restore]
method.
Any operation that modifies the table will fail while the table is in a checked out state.
To return the table to a normal state use [Self::checkout_latest]
Sourcepub async fn checkout_latest(&self) -> Result<()>
pub async fn checkout_latest(&self) -> Result<()>
Ensures the table is pointing at the latest version
This can be used to manually update a table when the read_consistency_interval is None
It can also be used to undo a [Self::checkout]
operation
Sourcepub async fn restore(&self) -> Result<()>
pub async fn restore(&self) -> Result<()>
Restore the table to the currently checked out version
This operation will fail if checkout has not been called previously
This operation will overwrite the latest version of the table with a previous version. Any changes made since the checked out version will no longer be visible.
Once the operation concludes the table will no longer be in a checked out state and the read_consistency_interval, if any, will apply.
Sourcepub async fn list_versions(&self) -> Result<Vec<Version>>
pub async fn list_versions(&self) -> Result<Vec<Version>>
List all the versions of the table
Sourcepub async fn list_indices(&self) -> Result<Vec<IndexConfig>>
pub async fn list_indices(&self) -> Result<Vec<IndexConfig>>
List all indices that have been created with Self::create_index
Sourcepub fn dataset_uri(&self) -> &str
pub fn dataset_uri(&self) -> &str
Get the underlying dataset URI
Warning: This is an internal API and the return value is subject to change.
Sourcepub async fn index_stats(
&self,
index_name: impl AsRef<str>,
) -> Result<Option<IndexStatistics>>
pub async fn index_stats( &self, index_name: impl AsRef<str>, ) -> Result<Option<IndexStatistics>>
Get statistics about an index. Returns None if the index does not exist.
Sourcepub async fn drop_index(&self, name: &str) -> Result<()>
pub async fn drop_index(&self, name: &str) -> Result<()>
Drop an index from the table.
Note: This is not yet available in LanceDB cloud.
This does not delete the index from disk, it just removes it from the table.
To delete the index, run Self::optimize()
after dropping the index.
Use Self::list_indices()
to find the names of the indices.
Sourcepub async fn prewarm_index(&self, name: &str) -> Result<()>
pub async fn prewarm_index(&self, name: &str) -> Result<()>
Prewarm an index in the table
This is a hint to fully load the index into memory. It can be used to avoid cold starts
It is generally wasteful to call this if the index does not fit into the available cache.
Note: This function is not yet supported on all indices, in which case it may do nothing.
Use Self::list_indices()
to find the names of the indices.
Sourcepub async fn wait_for_index(
&self,
index_names: &[&str],
timeout: Duration,
) -> Result<()>
pub async fn wait_for_index( &self, index_names: &[&str], timeout: Duration, ) -> Result<()>
Poll until the columns are fully indexed. Will return Error::Timeout if the columns are not fully indexed within the timeout.
Get the tags manager.
Sourcepub async fn stats(&self) -> Result<TableStatistics>
pub async fn stats(&self) -> Result<TableStatistics>
Retrieve statistics on the table
Trait Implementations§
Source§impl From<NativeTable> for Table
impl From<NativeTable> for Table
Source§fn from(table: NativeTable) -> Self
fn from(table: NativeTable) -> Self
Auto Trait Implementations§
impl Freeze for Table
impl !RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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>
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>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.