Struct SqlGenerator

Source
pub(crate) struct SqlGenerator<'a, R: Rng> {
    tables: Vec<Table>,
    rng: &'a mut R,
    relation_id: u32,
    bound_relations: Vec<Table>,
    bound_columns: Vec<Column>,
    is_mview: bool,
    recursion_weight: f64,
}

Fields§

§tables: Vec<Table>§rng: &'a mut R§relation_id: u32

Relation ID used to generate table names and aliases

§bound_relations: Vec<Table>

Relations bound in generated query. We might not read from all tables.

§bound_columns: Vec<Column>

Columns bound in generated query. May not contain all columns from Self::bound_relations. e.g. GROUP BY clause will constrain bound_columns.

§is_mview: bool

SqlGenerator can be used in two execution modes:

  1. Generating Query Statements.
  2. Generating queries for CREATE MATERIALIZED VIEW. Under this mode certain restrictions and workarounds are applied for unsupported stream executors.
§recursion_weight: f64

Implementations§

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub fn gen_agg(&mut self, ret: &DataType) -> Expr

Source

fn make_agg_expr( &mut self, func: PbAggKind, exprs: &[Expr], distinct: bool, filter: Option<Box<Expr>>, order_by: Vec<OrderByExpr>, ) -> Option<Expr>

Generates aggregate expressions. For internal / unsupported aggregators, we return None.

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub(crate) fn gen_explicit_cast( &mut self, ret: &DataType, context: SqlGeneratorContext, ) -> Expr

Source

fn gen_explicit_cast_inner( &mut self, ret: &DataType, context: SqlGeneratorContext, ) -> Option<Expr>

Generate casts from a cast map. TODO: Assign casts have to be tested via INSERT.

Source

pub(crate) fn gen_implicit_cast( &mut self, ret: &DataType, context: SqlGeneratorContext, ) -> Expr

NOTE: This can result in ambiguous expressions. Should only be used in unambiguous context.

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub(crate) fn gen_expr( &mut self, typ: &DataType, context: SqlGeneratorContext, ) -> Expr

In generating expression, there are two execution modes:

  1. Can have Aggregate expressions (can_agg = true) We can have aggregate of all bound columns (those present in GROUP BY and otherwise). Not all GROUP BY columns need to be aggregated.
  2. Can’t have Aggregate expressions (can_agg = false) Only columns present in GROUP BY can be selected.

inside_agg indicates if we are calling gen_expr inside an aggregate.

Source

fn gen_data_type(&mut self) -> DataType

Source

fn gen_data_type_inner(&mut self, depth: usize) -> DataType

Source

fn gen_list_data_type(&mut self, depth: usize) -> DataType

Source

fn gen_struct_data_type(&mut self, depth: usize) -> DataType

Source

pub(crate) fn gen_arbitrary_expr( &mut self, context: SqlGeneratorContext, ) -> (DataType, Expr)

Generates an arbitrary expression, but biased towards datatypes present in bound columns.

Source

fn gen_col(&mut self, typ: &DataType, context: SqlGeneratorContext) -> Expr

Source

pub(crate) fn gen_n_exprs_with_type( &mut self, n: usize, ret: &DataType, context: SqlGeneratorContext, ) -> Vec<Expr>

Generates n expressions of type ret.

Source

fn gen_exists(&mut self, ret: &DataType, context: SqlGeneratorContext) -> Expr

Source

pub(crate) fn gen_order_by(&mut self) -> Vec<OrderByExpr>

Generate ORDER BY expressions by choosing from available bound columns.

Source

pub(crate) fn gen_order_by_within(&mut self, exprs: &[Expr]) -> Vec<OrderByExpr>

Generate ORDER BY expressions by choosing from given expressions.

Source§

impl<'a, R: Rng + 'a> SqlGenerator<'a, R>

Source

pub(crate) fn generate_insert_statement( &mut self, table: &Table, row_count: usize, ) -> Statement

Source

pub(crate) fn generate_update_statements( &mut self, tables: &[Table], inserts: &[Statement], ) -> Result<Vec<Statement>>

Source

pub(crate) fn generate_update_statements_inner( &mut self, table: &Table, values: &[Vec<Expr>], pk_indices: &[usize], ) -> Vec<Statement>

Source

fn row_to_update_statement( table: &Table, pk_indices: &[usize], value_indices: &[usize], row: &[Expr], ) -> Statement

Source

fn create_selection_expr( table: &Table, selected_indices: &[usize], row: &[Expr], ) -> Expr

Source

fn generate_delete_statements( &mut self, table: &Table, values: &[Vec<Expr>], ) -> Vec<Statement>

Source

fn extract_insert_values(source: &Query) -> Result<&[Vec<Expr>]>

Source

fn gen_values( &mut self, data_types: &[DataType], row_count: usize, ) -> Vec<Vec<Expr>>

Source

fn gen_row(&mut self, data_types: &[DataType]) -> Vec<Expr>

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub fn gen_func(&mut self, ret: &DataType, context: SqlGeneratorContext) -> Expr

Source

fn gen_special_func( &mut self, ret: &DataType, context: SqlGeneratorContext, ) -> Expr

Generates functions with special properties, e.g. CASE, COALESCE, CONCAT, CONCAT_WS, OVERLAY. These require custom logic for arguments. For instance, OVERLAY requires a positive length argument, and CONCAT and CONCAT_WS require variable number of arguments.

Source

fn gen_overlay(&mut self, context: SqlGeneratorContext) -> Expr

We do custom generation for the OVERLAY function call. See: [https://github.com/risingwavelabs/risingwave/issues/10695] for rationale.

Source

fn gen_case(&mut self, ret: &DataType, context: SqlGeneratorContext) -> Expr

Source

fn gen_coalesce(&mut self, ret: &DataType, context: SqlGeneratorContext) -> Expr

Source

fn gen_concat(&mut self, context: SqlGeneratorContext) -> Expr

Source

fn gen_concat_ws(&mut self, context: SqlGeneratorContext) -> Expr

Source

fn gen_concat_args(&mut self, context: SqlGeneratorContext) -> Vec<Expr>

Source

fn gen_decode(&mut self, context: SqlGeneratorContext) -> Expr

Source

fn gen_fixed_func( &mut self, ret: &DataType, context: SqlGeneratorContext, ) -> Expr

Source§

impl<R: Rng> SqlGenerator<'_, R>

Generators

Source

pub(crate) fn gen_query(&mut self) -> (Query, Vec<Column>)

Generates query expression and returns its query schema as well.

Source

fn gen_complex_query(&mut self) -> (Query, Vec<Column>)

Generates a complex query which may recurse. e.g. through gen_with or other generated parts of the query.

Source

fn gen_simple_query(&mut self) -> (Query, Vec<Column>)

This query can still recurse, but it is “simpler” does not have “with” clause, “order by”. Which makes it more unlikely to recurse.

Source

pub(crate) fn gen_single_item_query(&mut self) -> (Query, Column)

Generates a query with a single SELECT item. e.g. SELECT v from t; Returns the query and the SELECT column alias.

Source

pub(crate) fn gen_local_query(&mut self) -> (Query, Vec<Column>)

Generates a query with local context. Used by WITH, Table Subquery in Relation

Source

pub(crate) fn gen_correlated_query(&mut self) -> (Query, Vec<Column>)

Generates a query with correlated context to ensure proper recursion.

Source

fn gen_with(&mut self) -> (Option<With>, Vec<Table>)

Source

fn gen_with_inner(&mut self) -> (With, Vec<Table>)

Source

fn gen_set_expr( &mut self, with_tables: Vec<Table>, num_select_items: usize, ) -> (SetExpr, Vec<Column>)

Source

fn gen_limit(&mut self, has_order_by: bool) -> Option<Expr>

Source

fn gen_select_stmt( &mut self, with_tables: Vec<Table>, num_select_items: usize, ) -> (Select, Vec<Column>)

Source

fn gen_select_list( &mut self, num_select_items: usize, ) -> (Vec<SelectItem>, Vec<Column>)

Source

fn gen_select_item( &mut self, i: usize, context: SqlGeneratorContext, ) -> (SelectItem, Column)

Source

fn gen_from(&mut self, with_tables: Vec<Table>) -> Vec<TableWithJoins>

Source

fn gen_where(&mut self) -> Option<Expr>

Source

fn gen_group_by(&mut self) -> Vec<Expr>

GROUP BY will constrain the generated columns.

Source

fn gen_grouping_sets(&mut self) -> Vec<Expr>

GROUPING SETS will constrain the generated columns.

Source

fn gen_random_bound_columns(&mut self) -> Vec<Column>

Source

fn gen_having(&mut self, have_group_by: bool) -> Option<Expr>

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub(crate) fn gen_from_relation(&mut self) -> (TableWithJoins, Vec<Table>)

A relation specified in the FROM clause.

Source

fn gen_no_join(&mut self) -> (TableWithJoins, Vec<Table>)

Source

fn gen_simple_table_factor(&mut self) -> (TableFactor, Table)

Source

fn gen_table_factor(&mut self) -> (TableFactor, Table)

Source

fn gen_table_factor_inner(&mut self) -> (TableFactor, Table)

Generates a table factor, and provides bound columns. Generated column names should be qualified by table name.

Source

fn gen_equi_join_columns( &mut self, left_columns: Vec<Column>, right_columns: Vec<Column>, ) -> Vec<(Column, Column)>

Source

fn gen_bool_with_tables(&mut self, tables: Vec<Table>) -> Expr

Source

fn gen_single_equi_join_expr( &mut self, left_columns: Vec<Column>, right_columns: Vec<Column>, ) -> Option<(Expr, Vec<(Column, Column)>)>

Source

fn gen_non_equi_expr( &mut self, available_join_on_columns: Vec<(Column, Column)>, ) -> Expr

Source

fn gen_more_equi_join_exprs( &mut self, available_join_on_columns: Vec<(Column, Column)>, ) -> Expr

Source

fn gen_arbitrary_bool( &mut self, left_table: Table, right_table: Table, ) -> Option<Expr>

Source

fn gen_join_on_expr( &mut self, left_columns: Vec<Column>, left_table: Table, right_columns: Vec<Column>, right_table: Table, ) -> Option<Expr>

Generates the ON clause in t JOIN t2 ON ... It will generate at least one equi join condition This will reduce chance of nested loop join from being generated.

Source

fn gen_join_constraint( &mut self, left_columns: Vec<Column>, left_table: Table, right_columns: Vec<Column>, right_table: Table, ) -> Option<JoinConstraint>

Source

fn gen_join_operator( &mut self, left_columns: Vec<Column>, left_table: Table, right_columns: Vec<Column>, right_table: Table, ) -> Option<JoinOperator>

Generates t1 JOIN t2 ON …

Source

fn gen_simple_join_clause(&mut self) -> Option<(TableWithJoins, Vec<Table>)>

Generates t1 JOIN t2 ON …

Source

fn gen_more_joins(&mut self) -> (TableWithJoins, Vec<Table>)

Generates three-way join.

Source

fn gen_table_subquery(&mut self) -> (TableFactor, Table)

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub(super) fn gen_range_scalar( &mut self, typ: &DataType, start: i64, end: i64, ) -> Option<Expr>

Generates integer scalar expression. Bound: [start, end). Type: DataType.

Source

pub(super) fn gen_simple_scalar(&mut self, typ: &DataType) -> Expr

Source

fn gen_simple_scalar_list(&mut self, ty: &DataType, n: usize) -> Vec<Expr>

Generates a list of n simple scalar values of a specific type.

Source

fn gen_int(&mut self, min: i64, max: i64) -> String

Source

fn gen_float(&mut self) -> String

Source

fn gen_temporal_scalar(&mut self, typ: &DataType) -> String

Source§

impl<R: Rng> SqlGenerator<'_, R>

Source

pub(crate) fn gen_time_window_func(&mut self) -> (TableFactor, Table)

Generates time window functions.

Source

fn gen_tumble(&mut self) -> (TableFactor, Table)

Generates TUMBLE. TUMBLE(data: TABLE, timecol: COLUMN, size: INTERVAL, offset?: INTERVAL)

Source

fn gen_hop(&mut self) -> (TableFactor, Table)

Generates HOP. HOP(data: TABLE, timecol: COLUMN, slide: INTERVAL, size: INTERVAL, offset?: INTERVAL)

Source

fn gen_secs(&mut self) -> u64

Source

fn secs_to_interval_expr(i: u64) -> Expr

Source

fn gen_slide(&mut self) -> (u64, Expr)

Source

fn gen_size(&mut self, slide_secs: u64) -> Expr

Size must be divisible by slide. i.e. size_secs = k * slide_secs. k cannot be too large, to avoid overflow.

Source§

impl<R: Rng> SqlGenerator<'_, R>

Context utils

Source

pub(crate) fn add_relations_to_context(&mut self, tables: Vec<Table>)

Source

pub(crate) fn new_local_context(&mut self) -> (Vec<Column>, Vec<Table>)

Source

pub(crate) fn restore_context( &mut self, (old_cols, old_rels): (Vec<Column>, Vec<Table>), )

Source

pub(crate) fn clone_local_context(&mut self) -> (Vec<Column>, Vec<Table>)

Source§

impl<R: Rng> SqlGenerator<'_, R>

Gen utils

Source

pub(crate) fn gen_table_name_with_prefix(&mut self, prefix: &str) -> String

Source

fn gen_relation_id(&mut self) -> u32

Source

pub(crate) fn gen_table_alias_with_prefix(&mut self, prefix: &str) -> TableAlias

Source§

impl<'a, R: Rng> SqlGenerator<'a, R>

Generators

Source

pub(crate) fn new(rng: &'a mut R, tables: Vec<Table>) -> Self

Source

pub(crate) fn new_for_mview(rng: &'a mut R, tables: Vec<Table>) -> Self

Source

pub(crate) fn gen_batch_query_stmt(&mut self) -> Statement

Source

pub(crate) fn gen_mview_stmt(&mut self, name: &str) -> (Statement, Table)

Source

fn flip_coin(&mut self) -> bool

50/50 chance to be true/false.

Source

pub(crate) fn can_recurse(&mut self) -> bool

Provide recursion bounds.

Auto Trait Implementations§

§

impl<'a, R> Freeze for SqlGenerator<'a, R>

§

impl<'a, R> RefUnwindSafe for SqlGenerator<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for SqlGenerator<'a, R>
where R: Send,

§

impl<'a, R> Sync for SqlGenerator<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for SqlGenerator<'a, R>

§

impl<'a, R> !UnwindSafe for SqlGenerator<'a, R>

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
§

impl<T> Conv for T

§

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

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

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
§

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

§

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

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

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

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

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

§

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

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

§

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

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

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

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

impl<T> FmtForward for T

§

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,

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

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,

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

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,

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

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,

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

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.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoResult<T> for T

§

type Err = Infallible

§

fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>

§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

§

fn lift_into(self) -> U

Performs the indexed conversion.
§

impl<M> MetricVecRelabelExt for M

§

fn relabel( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>

Equivalent to [RelabeledMetricVec::with_metric_level].
§

fn relabel_n( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, relabel_num: usize, ) -> RelabeledMetricVec<M>

Equivalent to [RelabeledMetricVec::with_metric_level_relabel_n].
§

fn relabel_debug_1( self, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>

Equivalent to [RelabeledMetricVec::with_metric_level_relabel_n] with metric_level set to MetricLevel::Debug and relabel_num set to 1.
§

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

§

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
§

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
§

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
§

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
§

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
§

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

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

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

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Scope for T

§

fn with<F, R>(self, f: F) -> R
where Self: Sized, F: FnOnce(Self) -> R,

Scoped with ownership.
§

fn with_ref<F, R>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Scoped with reference.
§

fn with_mut<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Scoped with mutable reference.
§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
§

impl<T> SerTo<T> for T

§

fn ser_to(self) -> Result<T, SinkError>

§

impl<T> Tap for T

§

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

Immutable access to a value. Read more
§

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

Mutable access to a value. Read more
§

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
§

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
§

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
§

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
§

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
§

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
§

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

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

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

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

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

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

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

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

impl<T> TryConv for T

§

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> LruValue for T
where T: Send + Sync,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> ParallelSend for T
where T: Send,

§

impl<T> Ungil for T
where T: Send,

§

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