Struct DeleteStatement
pub struct DeleteStatement { /* private fields */ }
Expand description
Delete existing rows from the table
§Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.cond_where(any![
Expr::col(Glyph::Id).lt(1),
Expr::col(Glyph::Id).gt(10),
])
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"DELETE FROM `glyph` WHERE `id` < 1 OR `id` > 10"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" < 1 OR "id" > 10"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" < 1 OR "id" > 10"#
);
Implementations§
§impl DeleteStatement
impl DeleteStatement
pub fn new() -> DeleteStatement
pub fn new() -> DeleteStatement
Construct a new DeleteStatement
pub fn from_table<T>(&mut self, tbl_ref: T) -> &mut DeleteStatementwhere
T: IntoTableRef,
pub fn from_table<T>(&mut self, tbl_ref: T) -> &mut DeleteStatementwhere
T: IntoTableRef,
Specify which table to delete from.
§Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"DELETE FROM `glyph` WHERE `id` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1"#
);
pub fn limit(&mut self, limit: u64) -> &mut DeleteStatement
pub fn limit(&mut self, limit: u64) -> &mut DeleteStatement
Limit number of updated rows.
pub fn returning(
&mut self,
returning_cols: ReturningClause,
) -> &mut DeleteStatement
pub fn returning( &mut self, returning_cols: ReturningClause, ) -> &mut DeleteStatement
RETURNING expressions.
§Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().columns([Glyph::Id]))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"DELETE FROM `glyph` WHERE `id` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
pub fn returning_col<C>(&mut self, col: C) -> &mut DeleteStatementwhere
C: IntoColumnRef,
pub fn returning_col<C>(&mut self, col: C) -> &mut DeleteStatementwhere
C: IntoColumnRef,
RETURNING expressions for a column.
§Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning_col(Glyph::Id)
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"DELETE FROM `glyph` WHERE `id` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
pub fn returning_all(&mut self) -> &mut DeleteStatement
pub fn returning_all(&mut self) -> &mut DeleteStatement
RETURNING expressions all columns.
§Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning_all()
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"DELETE FROM `glyph` WHERE `id` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING *"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING *"#
);
pub fn with(self, clause: WithClause) -> WithQuery
pub fn with(self, clause: WithClause) -> WithQuery
Create a WithQuery by specifying a WithClause to execute this query with.
§Examples
use sea_query::{*, IntoCondition, IntoIden, tests_cfg::*};
let select = SelectStatement::new()
.columns([Glyph::Id])
.from(Glyph::Table)
.and_where(Expr::col(Glyph::Image).like("0%"))
.to_owned();
let cte = CommonTableExpression::new()
.query(select)
.column(Glyph::Id)
.table_name(Alias::new("cte"))
.to_owned();
let with_clause = WithClause::new().cte(cte).to_owned();
let update = DeleteStatement::new()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).in_subquery(SelectStatement::new().column(Glyph::Id).from(Alias::new("cte")).to_owned()))
.to_owned();
let query = update.with(with_clause);
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"WITH `cte` (`id`) AS (SELECT `id` FROM `glyph` WHERE `image` LIKE '0%') DELETE FROM `glyph` WHERE `id` IN (SELECT `id` FROM `cte`)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"WITH "cte" ("id") AS (SELECT "id" FROM "glyph" WHERE "image" LIKE '0%') DELETE FROM "glyph" WHERE "id" IN (SELECT "id" FROM "cte")"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"WITH "cte" ("id") AS (SELECT "id" FROM "glyph" WHERE "image" LIKE '0%') DELETE FROM "glyph" WHERE "id" IN (SELECT "id" FROM "cte")"#
);
pub fn with_cte<C>(&mut self, clause: C) -> &mut DeleteStatementwhere
C: Into<WithClause>,
pub fn with_cte<C>(&mut self, clause: C) -> &mut DeleteStatementwhere
C: Into<WithClause>,
Create a Common Table Expression by specifying a [CommonTableExpression] or WithClause to execute this query with.
§Examples
use sea_query::{*, IntoCondition, IntoIden, tests_cfg::*};
let select = SelectStatement::new()
.columns([Glyph::Id])
.from(Glyph::Table)
.and_where(Expr::col(Glyph::Image).like("0%"))
.to_owned();
let cte = CommonTableExpression::new()
.query(select)
.column(Glyph::Id)
.table_name(Alias::new("cte"))
.to_owned();
let with_clause = WithClause::new().cte(cte).to_owned();
let query = DeleteStatement::new()
.with_cte(with_clause)
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).in_subquery(SelectStatement::new().column(Glyph::Id).from(Alias::new("cte")).to_owned()))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"WITH `cte` (`id`) AS (SELECT `id` FROM `glyph` WHERE `image` LIKE '0%') DELETE FROM `glyph` WHERE `id` IN (SELECT `id` FROM `cte`)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"WITH "cte" ("id") AS (SELECT "id" FROM "glyph" WHERE "image" LIKE '0%') DELETE FROM "glyph" WHERE "id" IN (SELECT "id" FROM "cte")"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"WITH "cte" ("id") AS (SELECT "id" FROM "glyph" WHERE "image" LIKE '0%') DELETE FROM "glyph" WHERE "id" IN (SELECT "id" FROM "cte")"#
);
§impl DeleteStatement
impl DeleteStatement
pub fn build_collect_any_into(
&self,
query_builder: &dyn QueryBuilder,
sql: &mut dyn SqlWriter,
)
pub fn build_collect_any_into( &self, query_builder: &dyn QueryBuilder, sql: &mut dyn SqlWriter, )
pub fn into_sub_query_statement(self) -> SubQueryStatement
pub fn into_sub_query_statement(self) -> SubQueryStatement
pub fn build_any(&self, query_builder: &dyn QueryBuilder) -> (String, Values)
pub fn build_any(&self, query_builder: &dyn QueryBuilder) -> (String, Values)
pub fn build_collect_any(
&self,
query_builder: &dyn QueryBuilder,
sql: &mut dyn SqlWriter,
) -> String
pub fn build_collect_any( &self, query_builder: &dyn QueryBuilder, sql: &mut dyn SqlWriter, ) -> String
§impl DeleteStatement
impl DeleteStatement
pub fn build_collect_into<T>(&self, query_builder: T, sql: &mut dyn SqlWriter)where
T: QueryBuilder,
pub fn build_collect_into<T>(&self, query_builder: T, sql: &mut dyn SqlWriter)where
T: QueryBuilder,
pub fn build_collect<T>(
&self,
query_builder: T,
sql: &mut dyn SqlWriter,
) -> Stringwhere
T: QueryBuilder,
pub fn build_collect<T>(
&self,
query_builder: T,
sql: &mut dyn SqlWriter,
) -> Stringwhere
T: QueryBuilder,
pub fn build<T>(&self, query_builder: T) -> (String, Values)where
T: QueryBuilder,
pub fn build<T>(&self, query_builder: T) -> (String, Values)where
T: QueryBuilder,
pub fn to_string<T>(&self, query_builder: T) -> Stringwhere
T: QueryBuilder,
pub fn to_string<T>(&self, query_builder: T) -> Stringwhere
T: QueryBuilder,
§impl DeleteStatement
impl DeleteStatement
pub fn add_order_by(&mut self, order: OrderExpr) -> &mut DeleteStatement
pub fn add_order_by(&mut self, order: OrderExpr) -> &mut DeleteStatement
pub fn clear_order_by(&mut self) -> &mut DeleteStatement
pub fn clear_order_by(&mut self) -> &mut DeleteStatement
pub fn order_by<T>(&mut self, col: T, order: Order) -> &mut DeleteStatementwhere
T: IntoColumnRef,
pub fn order_by<T>(&mut self, col: T, order: Order) -> &mut DeleteStatementwhere
T: IntoColumnRef,
pub fn order_by_expr(
&mut self,
expr: SimpleExpr,
order: Order,
) -> &mut DeleteStatement
pub fn order_by_expr( &mut self, expr: SimpleExpr, order: Order, ) -> &mut DeleteStatement
pub fn order_by_customs<I, T>(&mut self, cols: I) -> &mut DeleteStatement
pub fn order_by_customs<I, T>(&mut self, cols: I) -> &mut DeleteStatement
pub fn order_by_columns<I, T>(&mut self, cols: I) -> &mut DeleteStatement
pub fn order_by_columns<I, T>(&mut self, cols: I) -> &mut DeleteStatement
pub fn order_by_with_nulls<T>(
&mut self,
col: T,
order: Order,
nulls: NullOrdering,
) -> &mut DeleteStatementwhere
T: IntoColumnRef,
pub fn order_by_with_nulls<T>(
&mut self,
col: T,
order: Order,
nulls: NullOrdering,
) -> &mut DeleteStatementwhere
T: IntoColumnRef,
pub fn order_by_expr_with_nulls(
&mut self,
expr: SimpleExpr,
order: Order,
nulls: NullOrdering,
) -> &mut DeleteStatement
pub fn order_by_expr_with_nulls( &mut self, expr: SimpleExpr, order: Order, nulls: NullOrdering, ) -> &mut DeleteStatement
pub fn order_by_customs_with_nulls<I, T>(
&mut self,
cols: I,
) -> &mut DeleteStatement
pub fn order_by_customs_with_nulls<I, T>( &mut self, cols: I, ) -> &mut DeleteStatement
pub fn order_by_columns_with_nulls<I, T>(
&mut self,
cols: I,
) -> &mut DeleteStatement
pub fn order_by_columns_with_nulls<I, T>( &mut self, cols: I, ) -> &mut DeleteStatement
§impl DeleteStatement
impl DeleteStatement
pub fn and_or_where(
&mut self,
condition: LogicalChainOper,
) -> &mut DeleteStatement
pub fn and_or_where( &mut self, condition: LogicalChainOper, ) -> &mut DeleteStatement
pub fn cond_where<C>(&mut self, condition: C) -> &mut DeleteStatementwhere
C: IntoCondition,
pub fn cond_where<C>(&mut self, condition: C) -> &mut DeleteStatementwhere
C: IntoCondition,
pub fn and_where_option(
&mut self,
other: Option<SimpleExpr>,
) -> &mut DeleteStatement
pub fn and_where_option( &mut self, other: Option<SimpleExpr>, ) -> &mut DeleteStatement
pub fn and_where(&mut self, other: SimpleExpr) -> &mut DeleteStatement
pub fn and_where(&mut self, other: SimpleExpr) -> &mut DeleteStatement
Trait Implementations§
§impl Clone for DeleteStatement
impl Clone for DeleteStatement
§fn clone(&self) -> DeleteStatement
fn clone(&self) -> DeleteStatement
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl ConditionalStatement for DeleteStatement
impl ConditionalStatement for DeleteStatement
§fn cond_where<C>(&mut self, condition: C) -> &mut DeleteStatementwhere
C: IntoCondition,
fn cond_where<C>(&mut self, condition: C) -> &mut DeleteStatementwhere
C: IntoCondition,
Where condition, expressed with
any
and all
.
Calling cond_where
multiple times will conjoin them.
Calling or_where
after cond_where
will panic. Read more§fn and_where(&mut self, other: SimpleExpr) -> &mut Self
fn and_where(&mut self, other: SimpleExpr) -> &mut Self
§fn and_where_option(&mut self, other: Option<SimpleExpr>) -> &mut Self
fn and_where_option(&mut self, other: Option<SimpleExpr>) -> &mut Self
Optional and where, short hand for
if c.is_some() q.and_where(c)
. Read more§impl Debug for DeleteStatement
impl Debug for DeleteStatement
§impl Default for DeleteStatement
impl Default for DeleteStatement
§fn default() -> DeleteStatement
fn default() -> DeleteStatement
Returns the “default value” for a type. Read more
§impl OrderedStatement for DeleteStatement
impl OrderedStatement for DeleteStatement
§fn clear_order_by(&mut self) -> &mut DeleteStatement
fn clear_order_by(&mut self) -> &mut DeleteStatement
Clear order expressions
§fn order_by<T>(&mut self, col: T, order: Order) -> &mut Selfwhere
T: IntoColumnRef,
fn order_by<T>(&mut self, col: T, order: Order) -> &mut Selfwhere
T: IntoColumnRef,
Order by column. Read more
§fn order_by_expr(&mut self, expr: SimpleExpr, order: Order) -> &mut Self
fn order_by_expr(&mut self, expr: SimpleExpr, order: Order) -> &mut Self
Order by
SimpleExpr
.§fn order_by_customs<I, T>(&mut self, cols: I) -> &mut Self
fn order_by_customs<I, T>(&mut self, cols: I) -> &mut Self
Order by custom string.
§fn order_by_columns<I, T>(&mut self, cols: I) -> &mut Self
fn order_by_columns<I, T>(&mut self, cols: I) -> &mut Self
Order by vector of columns.
§fn order_by_with_nulls<T>(
&mut self,
col: T,
order: Order,
nulls: NullOrdering,
) -> &mut Selfwhere
T: IntoColumnRef,
fn order_by_with_nulls<T>(
&mut self,
col: T,
order: Order,
nulls: NullOrdering,
) -> &mut Selfwhere
T: IntoColumnRef,
Order by column with nulls order option. Read more
§fn order_by_expr_with_nulls(
&mut self,
expr: SimpleExpr,
order: Order,
nulls: NullOrdering,
) -> &mut Self
fn order_by_expr_with_nulls( &mut self, expr: SimpleExpr, order: Order, nulls: NullOrdering, ) -> &mut Self
Order by
SimpleExpr
with nulls order option.§fn order_by_customs_with_nulls<I, T>(&mut self, cols: I) -> &mut Self
fn order_by_customs_with_nulls<I, T>(&mut self, cols: I) -> &mut Self
Order by custom string with nulls order option.
§fn order_by_columns_with_nulls<I, T>(&mut self, cols: I) -> &mut Self
fn order_by_columns_with_nulls<I, T>(&mut self, cols: I) -> &mut Self
Order by vector of columns with nulls order option.
§impl PartialEq for DeleteStatement
impl PartialEq for DeleteStatement
§impl QueryStatementBuilder for DeleteStatement
impl QueryStatementBuilder for DeleteStatement
§fn build_collect_any_into(
&self,
query_builder: &dyn QueryBuilder,
sql: &mut dyn SqlWriter,
)
fn build_collect_any_into( &self, query_builder: &dyn QueryBuilder, sql: &mut dyn SqlWriter, )
Build corresponding SQL statement into the SqlWriter for certain database backend and collect query parameters
fn into_sub_query_statement(self) -> SubQueryStatement
§fn build_any(&self, query_builder: &dyn QueryBuilder) -> (String, Values)
fn build_any(&self, query_builder: &dyn QueryBuilder) -> (String, Values)
Build corresponding SQL statement for certain database backend and collect query parameters into a vector
§fn build_collect_any(
&self,
query_builder: &dyn QueryBuilder,
sql: &mut dyn SqlWriter,
) -> String
fn build_collect_any( &self, query_builder: &dyn QueryBuilder, sql: &mut dyn SqlWriter, ) -> String
Build corresponding SQL statement for certain database backend and collect query parameters
§impl QueryStatementWriter for DeleteStatement
impl QueryStatementWriter for DeleteStatement
fn build_collect_into<T>(&self, query_builder: T, sql: &mut dyn SqlWriter)where
T: QueryBuilder,
§fn to_string<T>(&self, query_builder: T) -> Stringwhere
T: QueryBuilder,
fn to_string<T>(&self, query_builder: T) -> Stringwhere
T: QueryBuilder,
Build corresponding SQL statement for certain database backend and return SQL string Read more
§fn build<T>(&self, query_builder: T) -> (String, Values)where
T: QueryBuilder,
fn build<T>(&self, query_builder: T) -> (String, Values)where
T: QueryBuilder,
Build corresponding SQL statement for certain database backend and collect query parameters into a vector Read more
§fn build_collect<T>(&self, query_builder: T, sql: &mut dyn SqlWriter) -> Stringwhere
T: QueryBuilder,
fn build_collect<T>(&self, query_builder: T, sql: &mut dyn SqlWriter) -> Stringwhere
T: QueryBuilder,
Build corresponding SQL statement for certain database backend and collect query parameters Read more
§impl SqlxBinder for DeleteStatement
impl SqlxBinder for DeleteStatement
fn build_sqlx<T>(&self, query_builder: T) -> (String, SqlxValues)where
T: QueryBuilder,
fn build_any_sqlx( &self, query_builder: &dyn QueryBuilder, ) -> (String, SqlxValues)
§impl StatementBuilder for DeleteStatement
impl StatementBuilder for DeleteStatement
§fn build(&self, db_backend: &DatabaseBackend) -> Statement
fn build(&self, db_backend: &DatabaseBackend) -> Statement
Method to call in order to build a Statement
impl StructuralPartialEq for DeleteStatement
Auto Trait Implementations§
impl Freeze for DeleteStatement
impl !RefUnwindSafe for DeleteStatement
impl Send for DeleteStatement
impl Sync for DeleteStatement
impl Unpin for DeleteStatement
impl !UnwindSafe for DeleteStatement
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§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,
Borrows
self
and passes that borrow into the pipe function. Read more§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,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§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
§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
§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
Borrows
self
, then passes self.as_ref()
into the pipe function.§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
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.§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
Borrows
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.§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
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.§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
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.