pub struct QueryBuilder<T, E> { /* private fields */ }Expand description
A fluent Query Builder for constructing SQL queries.
QueryBuilder provides a type-safe, ergonomic interface for building and executing
SQL queries across different database backends. It supports filtering, ordering,
pagination, and both SELECT and INSERT operations.
§Type Parameter
'a- Lifetime of the database reference (used for PhantomData)T- The Model type this query operates onE- The connection type (Database or Transaction)
§Fields
db- Reference to the database connection pool or transactiontable_name- Static string containing the table namecolumns_info- Metadata about each column in the tablecolumns- List of column names in snake_case formatselect_columns- Specific columns to select (empty = SELECT *)where_clauses- List of filter functions to applyorder_clauses- List of ORDER BY clauseslimit- Maximum number of rows to returnoffset- Number of rows to skip (for pagination)_marker- PhantomData to bind the generic type T
Implementations§
Source§impl<T, E> QueryBuilder<T, E>
impl<T, E> QueryBuilder<T, E>
Sourcepub fn new(
tx: E,
driver: Drivers,
table_name: &'static str,
columns_info: Vec<ColumnInfo>,
columns: Vec<String>,
) -> Self
pub fn new( tx: E, driver: Drivers, table_name: &'static str, columns_info: Vec<ColumnInfo>, columns: Vec<String>, ) -> Self
Creates a new QueryBuilder instance.
This constructor is typically called internally via db.model::<T>().
You rarely need to call this directly.
§Arguments
db- Reference to the database connectiontable_name- Name of the table to querycolumns_info- Metadata about table columnscolumns- List of column names
§Returns
A new QueryBuilder instance ready for query construction
§Example
// Usually called via db.model::<User>()
let query = db.model::<User>();Sourcepub fn filter_subquery<S, SE>(
self,
col: &'static str,
op: Op,
subquery: QueryBuilder<S, SE>,
) -> Self
pub fn filter_subquery<S, SE>( self, col: &'static str, op: Op, subquery: QueryBuilder<S, SE>, ) -> Self
Sourcepub async fn truncate(self) -> Result<(), Error>
pub async fn truncate(self) -> Result<(), Error>
Truncates the table associated with this Model.
Uses TRUNCATE TABLE for Postgres/MySQL and DELETE FROM for SQLite.
§Returns
Ok(())on successErr(sqlx::Error)on database failure
Sourcepub fn union(self, other: QueryBuilder<T, E>) -> Selfwhere
T: AnyImpl + 'static,
E: 'static,
pub fn union(self, other: QueryBuilder<T, E>) -> Selfwhere
T: AnyImpl + 'static,
E: 'static,
Combines the results of this query with another query using UNION.
Sourcepub fn union_all(self, other: QueryBuilder<T, E>) -> Selfwhere
T: AnyImpl + 'static,
E: 'static,
pub fn union_all(self, other: QueryBuilder<T, E>) -> Selfwhere
T: AnyImpl + 'static,
E: 'static,
Combines the results of this query with another query using UNION ALL.
Sourcepub fn filter<V>(self, col: &'static str, op: Op, value: V) -> Self
pub fn filter<V>(self, col: &'static str, op: Op, value: V) -> Self
Adds a WHERE clause to the query.
This method adds a filter condition to the query. Multiple filters can be chained and will be combined with AND operators. The value is bound as a parameter to prevent SQL injection.
§Type Parameters
V- The type of the value to filter by. Must be encodable for SQL queries.
§Arguments
col- The column name to filter onop- The comparison operator (e.g., “=”, “>”, “LIKE”, “IN”)value- The value to compare against
§Example
query.filter("age", Op::Gte, 18)Sourcepub fn not_filter<V>(self, col: &'static str, op: Op, value: V) -> Self
pub fn not_filter<V>(self, col: &'static str, op: Op, value: V) -> Self
Adds an AND NOT WHERE clause to the query.
Sourcepub fn or_not_filter<V>(self, col: &'static str, op: Op, value: V) -> Self
pub fn or_not_filter<V>(self, col: &'static str, op: Op, value: V) -> Self
Adds an OR NOT WHERE clause to the query.
Sourcepub fn or_between<V>(self, col: &'static str, start: V, end: V) -> Self
pub fn or_between<V>(self, col: &'static str, start: V, end: V) -> Self
Sourcepub fn or_in_list<V>(self, col: &'static str, values: Vec<V>) -> Self
pub fn or_in_list<V>(self, col: &'static str, values: Vec<V>) -> Self
Adds an OR IN list clause to the query.
Sourcepub fn group<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
pub fn group<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
Groups filters inside parentheses with an AND operator.
Sourcepub fn or_group<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
pub fn or_group<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
Groups filters inside parentheses with an OR operator.
Sourcepub fn where_raw<V>(self, sql: &str, value: V) -> Self
pub fn where_raw<V>(self, sql: &str, value: V) -> Self
Adds a raw WHERE clause with a placeholder and a single value.
This allows writing raw SQL conditions with a ? placeholder.
To use multiple placeholders with different types, chain multiple where_raw calls.
§Arguments
sql- Raw SQL string with one?placeholder (e.g., “age > ?”)value- Value to bind
§Example
db.model::<User>()
.where_raw("name = ?", "Alice".to_string())
.where_raw("age >= ?", 18)
.scan()
.await?;Sourcepub fn or_where_raw<V>(self, sql: &str, value: V) -> Self
pub fn or_where_raw<V>(self, sql: &str, value: V) -> Self
Adds a raw OR WHERE clause with a placeholder.
Sourcepub fn equals<V>(self, col: &'static str, value: V) -> Self
pub fn equals<V>(self, col: &'static str, value: V) -> Self
Adds an equality filter to the query.
This is a convenience wrapper around filter() for simple equality checks.
It is equivalent to calling filter(col, "=", value).
§Type Parameters
V- The type of the value to compare against.
§Arguments
col- The column name to filter on.value- The value to match.
§Example
// Equivalent to filter("age", Op::Eq, 18)
query.equals("age", 18)Sourcepub fn order(self, order: &str) -> Self
pub fn order(self, order: &str) -> Self
Adds an ORDER BY clause to the query.
Specifies the sort order for the query results. Multiple order clauses can be added and will be applied in the order they were added.
§Arguments
order- The ORDER BY expression (e.g., “created_at DESC”, “age ASC, name DESC”)
§Example
// Single column ascending (ASC is default)
query.order("age")
// Single column descending
query.order("created_at DESC")
// Multiple columns
query.order("age DESC, username ASC")
// Chain multiple order clauses
query
.order("priority DESC")
.order("created_at ASC")Sourcepub fn alias(self, alias: &str) -> Self
pub fn alias(self, alias: &str) -> Self
Defines a SQL alias for the primary table in the query.
This method allows you to set a short alias for the model’s underlying table.
It is highly recommended when writing complex queries with multiple JOIN clauses,
preventing the need to repeat the full table name in .filter(), .equals(), or .select().
§Arguments
alias- A string slice representing the alias to be used (e.g., “u”, “rp”).
§Example
// Using 'u' as an alias for the User table
let results = db.model::<User>()
.alias("u")
.join("role_permissions rp", "rp.role_id = u.role")
.equals("u.id", user_id)
.select("u.username, rp.permission_id")
.scan_as::<UserPermissionDTO>()
.await?;Sourcepub fn debug(self) -> Self
pub fn debug(self) -> Self
Placeholder for eager loading relationships (preload).
This method is reserved for future implementation of relationship preloading.
Currently, it returns self unchanged to maintain the fluent interface.
§Future Implementation
Will support eager loading of related models to avoid N+1 query problems:
// Future usage example
query.preload("posts").preload("comments")Activates debug mode for this query.
When enabled, the generated SQL query will be logged using the log crate
at the DEBUG level before execution.
§Note
To see the output, you must initialize a logger in your application (e.g., using env_logger)
and configure it to display debug logs for bottle_orm.
§Example
db.model::<User>()
.filter("active", "=", true)
.debug() // Logs SQL: SELECT * FROM "user" WHERE "active" = $1
.scan()
.await?;Sourcepub fn is_not_null(self, col: &str) -> Self
pub fn is_not_null(self, col: &str) -> Self
Sourcepub fn with_deleted(self) -> Self
pub fn with_deleted(self) -> Self
Sourcepub fn join(self, table: &str, s_query: &str) -> Self
pub fn join(self, table: &str, s_query: &str) -> Self
Placeholder for JOIN operations.
This method is reserved for future implementation of SQL JOINs.
Currently, it returns self unchanged to maintain the fluent interface.
§Future Implementation
Will support various types of JOINs (INNER, LEFT, RIGHT, FULL):
Adds a JOIN clause to the query.
* `table` - The name of the table to join.
* `s_query` - The ON clause condition (e.g., "users.id = posts.user_id").
```rust,ignore
query.join("posts", "users.id = posts.user_id")Sourcepub fn left_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
pub fn left_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
Sourcepub fn right_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
pub fn right_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
Sourcepub fn inner_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
pub fn inner_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
Sourcepub fn full_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
pub fn full_join_raw<V>(self, table: &str, on: &str, value: V) -> Self
Sourcepub fn left_join(self, table: &str, on: &str) -> Self
pub fn left_join(self, table: &str, on: &str) -> Self
Adds a LEFT JOIN clause.
Performs a LEFT JOIN with another table. Returns all records from the left table, and the matched records from the right table (or NULL if no match).
§Arguments
table- The name of the table to join withon- The join condition (e.g., “users.id = posts.user_id”)
§Example
// Get all users and their posts (if any)
let users_with_posts = db.model::<User>()
.left_join("posts", "users.id = posts.user_id")
.scan()
.await?;Sourcepub fn right_join(self, table: &str, on: &str) -> Self
pub fn right_join(self, table: &str, on: &str) -> Self
Adds a RIGHT JOIN clause.
Performs a RIGHT JOIN with another table. Returns all records from the right table, and the matched records from the left table (or NULL if no match).
§Arguments
table- The name of the table to join withon- The join condition
§Example
let posts_with_users = db.model::<Post>()
.right_join("users", "posts.user_id = users.id")
.scan()
.await?;Sourcepub fn inner_join(self, table: &str, on: &str) -> Self
pub fn inner_join(self, table: &str, on: &str) -> Self
Adds an INNER JOIN clause.
Performs an INNER JOIN with another table. Returns records that have matching values in both tables.
§Arguments
table- The name of the table to join withon- The join condition
§Example
// Get only users who have posts
let active_users = db.model::<User>()
.inner_join("posts", "users.id = posts.user_id")
.scan()
.await?;Sourcepub fn group_by(self, columns: &str) -> Self
pub fn group_by(self, columns: &str) -> Self
Adds a GROUP BY clause to the query.
Groups rows that have the same values into summary rows. Often used with aggregate functions (COUNT, MAX, MIN, SUM, AVG).
§Arguments
columns- Comma-separated list of columns to group by
§Example
// Count users by age group
let stats: Vec<(i32, i64)> = db.model::<User>()
.select("age, COUNT(*)")
.group_by("age")
.scan()
.await?;Sourcepub fn having<V>(self, col: &'static str, op: Op, value: V) -> Self
pub fn having<V>(self, col: &'static str, op: Op, value: V) -> Self
Adds a HAVING clause to the query.
Used to filter groups created by group_by. Similar to filter (WHERE),
but operates on grouped records and aggregate functions.
§Arguments
col- The column or aggregate function to filter onop- Comparison operatorvalue- Value to compare against
§Example
// Get ages with more than 5 users
let popular_ages = db.model::<User>()
.select("age, COUNT(*)")
.group_by("age")
.having("COUNT(*)", Op::Gt, 5)
.scan()
.await?;Sourcepub fn pagination(
self,
max_value: usize,
default: usize,
page: usize,
value: isize,
) -> Result<Self, Error>
pub fn pagination( self, max_value: usize, default: usize, page: usize, value: isize, ) -> Result<Self, Error>
Applies pagination with validation and limits.
This is a convenience method that combines limit() and offset() with
built-in validation and maximum value enforcement for safer pagination.
§Arguments
max_value- Maximum allowed items per pagedefault- Default value ifvalueexceedsmax_valuepage- Zero-based page numbervalue- Requested items per page
§Returns
Ok(Self)- The updated QueryBuilder with pagination appliedErr(Error)- Ifvalueis negative
§Pagination Logic
- Validates that
valueis non-negative - If
value>max_value, usesdefaultinstead - Calculates offset as:
value * page - Sets limit to
value
§Example
// Page 0 with 10 items (page 1 in 1-indexed systems)
query.pagination(100, 20, 0, 10)? // LIMIT 10 OFFSET 0
// Page 2 with 25 items (page 3 in 1-indexed systems)
query.pagination(100, 20, 2, 25)? // LIMIT 25 OFFSET 50
// Request too many items, falls back to default
query.pagination(100, 20, 0, 150)? // LIMIT 20 OFFSET 0 (150 > 100)
// Error: negative value
query.pagination(100, 20, 0, -10)? // Returns ErrorSourcepub fn select(self, columns: &str) -> Self
pub fn select(self, columns: &str) -> Self
Selects specific columns to return.
By default, queries use SELECT * to return all columns. This method
allows you to specify exactly which columns should be returned.
Note: Columns are pushed exactly as provided, without automatic snake_case conversion, allowing for aliases and raw SQL fragments.
§Arguments
columns- Comma-separated list of column names to select
§Example
// Select single column
query.select("id")
// Select multiple columns
query.select("id, username, email")
// Select with SQL functions and aliases (now supported)
query.select("COUNT(*) as total_count")Sourcepub fn omit(self, columns: &str) -> Self
pub fn omit(self, columns: &str) -> Self
Excludes specific columns from the query results.
This is the inverse of select(). Instead of specifying which columns to include,
you specify which columns to exclude. All other columns will be returned.
§Arguments
columns- Comma-separated list of column names to exclude
§Priority
If both select() and omit() are used, select() takes priority.
§Example
// Exclude password from results
let user = db.model::<User>()
.omit("password")
.first()
.await?;
// Exclude multiple fields
let user = db.model::<User>()
.omit("password, secret_token")
.first()
.await?;
// Using with generated field constants (autocomplete support)
let user = db.model::<User>()
.omit(user_fields::PASSWORD)
.first()
.await?;Sourcepub fn offset(self, offset: usize) -> Self
pub fn offset(self, offset: usize) -> Self
Sets the query offset (pagination).
Specifies the number of rows to skip before starting to return rows.
Commonly used in combination with limit() for pagination.
§Arguments
offset- Number of rows to skip
§Example
// Skip first 20 rows
query.offset(20)
// Pagination: page 3 with 10 items per page
query.limit(10).offset(20) // Skip 2 pages = 20 itemsSourcepub fn limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> Self
Sets the maximum number of records to return.
Limits the number of rows returned by the query. Essential for pagination and preventing accidentally fetching large result sets.
§Arguments
limit- Maximum number of rows to return
§Example
// Return at most 10 rows
query.limit(10)
// Pagination: 50 items per page
query.limit(50).offset(page * 50)Sourcepub fn insert<'b>(
&'b mut self,
model: &'b T,
) -> BoxFuture<'b, Result<(), Error>>
pub fn insert<'b>( &'b mut self, model: &'b T, ) -> BoxFuture<'b, Result<(), Error>>
Inserts a new record into the database based on the model instance.
This method serializes the model into a SQL INSERT statement with proper type handling for primitives, dates, UUIDs, and other supported types.
§Type Binding Strategy
The method uses string parsing as a temporary solution for type binding.
Values are converted to strings via the model’s to_map() method, then
parsed back to their original types for proper SQL binding.
§Supported Types for Insert
- Integers:
i32,i64(INTEGER, BIGINT) - Boolean:
bool(BOOLEAN) - Float:
f64(DOUBLE PRECISION) - Text:
String(TEXT, VARCHAR) - UUID:
Uuid(UUID) - All versions 1-7 supported - DateTime:
DateTime<Utc>(TIMESTAMPTZ) - NaiveDateTime: (TIMESTAMP)
- NaiveDate: (DATE)
- NaiveTime: (TIME)
§Arguments
model- Reference to the model instance to insert
§Returns
Ok(&Self)- Reference to self for method chainingErr(sqlx::Error)- Database error during insertion
§Example
use chrono::Utc;
let new_user = User {
id: Uuid::new_v4(),
username: "john_doe".to_string(),
email: "john@example.com".to_string(),
age: 25,
active: true,
created_at: Utc::now(),
};
db.model::<User>().insert(&new_user).await?;Sourcepub fn batch_insert<'b>(
&'b mut self,
models: &'b [T],
) -> BoxFuture<'b, Result<(), Error>>
pub fn batch_insert<'b>( &'b mut self, models: &'b [T], ) -> BoxFuture<'b, Result<(), Error>>
Inserts multiple records into the database in a single batch operation.
This is significantly faster than performing individual inserts in a loop as it generates a single SQL statement with multiple VALUES groups.
§Type Binding Strategy
Similar to the single record insert, this method uses string parsing for
type binding. It ensures that all columns defined in the model are included
in the insert statement, providing NULL for any missing optional values.
§Arguments
models- A slice of model instances to insert
§Returns
Ok(())- Successfully inserted all recordsErr(sqlx::Error)- Database error during insertion
§Example
let users = vec![
User { username: "alice".to_string(), ... },
User { username: "bob".to_string(), ... },
];
db.model::<User>().batch_insert(&users).await?;Sourcepub fn upsert<'b>(
&'b mut self,
model: &'b T,
conflict_columns: &'b [&'b str],
update_columns: &'b [&'b str],
) -> BoxFuture<'b, Result<u64, Error>>
pub fn upsert<'b>( &'b mut self, model: &'b T, conflict_columns: &'b [&'b str], update_columns: &'b [&'b str], ) -> BoxFuture<'b, Result<u64, Error>>
Inserts a record or updates it if a conflict occurs (UPSERT).
This method provides a cross-database way to perform “Insert or Update” operations.
It uses ON CONFLICT for PostgreSQL and SQLite, and ON DUPLICATE KEY UPDATE for MySQL.
§Arguments
model- The model instance to insert or updateconflict_columns- Columns that trigger the conflict (e.g., primary key or unique columns)update_columns- Columns to update when a conflict occurs
§Returns
Ok(u64)- The number of rows affectedErr(sqlx::Error)- Database error
§Example
let user = User { id: 1, username: "alice".to_string(), age: 25 };
// If id 1 exists, update username and age
db.model::<User>().upsert(&user, &["id"], &["username", "age"]).await?;Sourcepub fn to_sql(&self) -> String
pub fn to_sql(&self) -> String
Returns the generated SQL string for debugging purposes.
This method constructs the SQL query string without executing it. Useful for debugging and logging query construction. Note that this shows placeholders (?, $1, etc.) rather than actual bound values.
§Returns
A String containing the SQL query that would be executed
§Example
let query = db.model::<User>()
.filter("age", ">=", 18)
.order("created_at DESC")
.limit(10);
println!("SQL: {}", query.to_sql());
// Output: SELECT * FROM "user" WHERE 1=1 AND "age" >= $1 ORDER BY created_at DESCSourcepub async fn scan<R>(self) -> Result<Vec<R>, Error>
pub async fn scan<R>(self) -> Result<Vec<R>, Error>
Executes the query and returns a list of results.
This method builds and executes a SELECT query with all accumulated filters, ordering, and pagination settings. It returns all matching rows as a vector.
§Type Parameters
R- The result type. Must implementFromRowfor deserialization from database rows.
§Returns
Ok(Vec<R>)- Vector of results (empty if no matches)Err(sqlx::Error)- Database error during query execution
§Example
// Get all adult users, ordered by age, limited to 10
let users: Vec<User> = db.model::<User>()
.filter("age", ">=", 18)
.order("age DESC")
.limit(10)
.scan()
.await?;
// Get users by UUID
let user_id = Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000")?;
let users: Vec<User> = db.model::<User>()
.filter("id", "=", user_id)
.scan()
.await?;
// Empty result is Ok
let results: Vec<User> = db.model::<User>()
.filter("age", ">", 200)
.scan()
.await?; // Returns empty Vec, not an errorSourcepub async fn scan_as<R>(self) -> Result<Vec<R>, Error>
pub async fn scan_as<R>(self) -> Result<Vec<R>, Error>
Executes the query and maps the result to a custom DTO.
Sourcepub async fn first<R>(self) -> Result<R, Error>
pub async fn first<R>(self) -> Result<R, Error>
Executes the query and returns only the first result.
Sourcepub async fn scalar<O>(self) -> Result<O, Error>
pub async fn scalar<O>(self) -> Result<O, Error>
Executes the query and returns a single scalar value.
Sourcepub fn update<'b, V>(
&'b mut self,
col: &str,
value: V,
) -> BoxFuture<'b, Result<u64, Error>>
pub fn update<'b, V>( &'b mut self, col: &str, value: V, ) -> BoxFuture<'b, Result<u64, Error>>
Sourcepub fn update_partial<'b, P: AnyImpl>(
&'b mut self,
partial: &P,
) -> BoxFuture<'b, Result<u64, Error>>
pub fn update_partial<'b, P: AnyImpl>( &'b mut self, partial: &P, ) -> BoxFuture<'b, Result<u64, Error>>
Updates columns based on a partial model (struct implementing AnyImpl).
This allows updating a subset of columns using a custom struct.
The struct must implement AnyImpl (usually via #[derive(FromAnyRow)]).
§Arguments
partial- The partial model containing new values
§Returns
Ok(u64)- The number of rows affected
Sourcepub fn update_raw<'b, V>(
&'b mut self,
col: &str,
expr: &str,
value: V,
) -> BoxFuture<'b, Result<u64, Error>>
pub fn update_raw<'b, V>( &'b mut self, col: &str, expr: &str, value: V, ) -> BoxFuture<'b, Result<u64, Error>>
Updates a column using a raw SQL expression.
This allows for complex updates like incrementing values or using database functions.
You can use a ? placeholder in the expression and provide a value to bind.
§Arguments
col- The column name to updateexpr- The raw SQL expression (e.g., “age + 1” or “age + ?”)value- The value to bind for the placeholder
§Example
// Increment age by 1
db.model::<User>()
.filter("id", "=", 1)
.update_raw("age", "age + 1", 0)
.await?;
// Increment age by a variable
db.model::<User>()
.filter("id", "=", 1)
.update_raw("age", "age + ?", 5)
.await?;Sourcepub async fn delete(self) -> Result<u64, Error>
pub async fn delete(self) -> Result<u64, Error>
Executes a DELETE query based on the current filters.
If the model has a #[orm(soft_delete)] column, this method performs
an UPDATE setting the soft delete column to the current timestamp instead
of physically deleting the record.
For permanent deletion, use hard_delete().
§Returns
Ok(u64)- The number of rows deleted (or soft-deleted)Err(sqlx::Error)- Database error
Sourcepub async fn hard_delete(self) -> Result<u64, Error>
pub async fn hard_delete(self) -> Result<u64, Error>
Permanently removes records from the database.
This method performs a physical DELETE, bypassing any soft delete logic. Use this when you need to permanently remove records.
§Returns
Ok(u64)- The number of rows deletedErr(sqlx::Error)- Database error
§Example
// Permanently delete soft-deleted records older than 30 days
db.model::<User>()
.with_deleted()
.filter("deleted_at", "<", thirty_days_ago)
.hard_delete()
.await?;Auto Trait Implementations§
impl<T, E> Freeze for QueryBuilder<T, E>where
E: Freeze,
impl<T, E> !RefUnwindSafe for QueryBuilder<T, E>
impl<T, E> Send for QueryBuilder<T, E>
impl<T, E> Sync for QueryBuilder<T, E>
impl<T, E> Unpin for QueryBuilder<T, E>
impl<T, E> UnsafeUnpin for QueryBuilder<T, E>where
E: UnsafeUnpin,
impl<T, E> !UnwindSafe for QueryBuilder<T, E>
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> 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 more