Skip to main content

ParserContext

Struct ParserContext 

Source
pub struct ParserContext<'a> {
    pub(crate) parser: Parser<'a>,
    pub(crate) sql: &'a str,
    pub(crate) scheduled_time: Option<DateTime<Utc>>,
}
Expand description

GrepTime SQL parser context, a simple wrapper for Datafusion SQL parser.

Fields§

§parser: Parser<'a>§sql: &'a str§scheduled_time: Option<DateTime<Utc>>

Optional scheduled time for now() evaluation in TQL parameters.

Implementations§

Source§

impl ParserContext<'_>

Source

pub fn new<'a>( dialect: &'a dyn Dialect, sql: &'a str, ) -> Result<ParserContext<'a>>

Construct a new ParserContext.

Source

pub fn parser_query(&mut self) -> Result<Box<Query>>

Parses parser context to Query.

Source

pub fn create_with_dialect( sql: &str, dialect: &dyn Dialect, opts: ParseOptions, ) -> Result<Vec<Statement>>

Parses SQL with given dialect

Source

pub fn parse_table_name(sql: &str, dialect: &dyn Dialect) -> Result<ObjectName>

Source

pub(crate) fn intern_parse_table_name(&mut self) -> Result<ObjectName>

Source

pub fn parse_table_name_fully( sql: &str, dialect: &dyn Dialect, ) -> Result<ObjectName>

Self::parse_table_name that also refuses a text the dialect parses only as a prefix of itself.

Self::parse_table_name reads one object name and stops at the first token it cannot use, so "a"."b" trailing would otherwise resolve to a.b with the rest silently dropped.

Source

pub fn parse_function(sql: &str, dialect: &dyn Dialect) -> Result<Expr>

Source

pub fn parse_statement(&mut self) -> Result<Statement>

Parses parser context to a set of statements.

Source

pub fn parse_mysql_prepare_stmt( sql: &str, dialect: &dyn Dialect, ) -> Result<(String, String)>

Parses MySQL style ‘PREPARE stmt_name FROM stmt’ into a (stmt_name, stmt) tuple.

Source

pub fn parse_mysql_execute_stmt( sql: &str, dialect: &dyn Dialect, ) -> Result<(String, Vec<Expr>)>

Parses MySQL style ‘EXECUTE stmt_name USING param_list’ into a stmt_name string and a list of parameters.

Source

pub fn parse_mysql_deallocate_stmt( sql: &str, dialect: &dyn Dialect, ) -> Result<String>

Parses MySQL style ‘DEALLOCATE stmt_name’ into a stmt_name string.

Source

pub fn unsupported<T>(&self, keyword: String) -> Result<T>

Raises an “unsupported statement” error.

Source

pub(crate) fn expected<T>( &self, expected: &str, found: TokenWithSpan, ) -> Result<T>

Source

pub fn matches_keyword(&mut self, expected: Keyword) -> bool

Source

pub fn consume_token(&mut self, expected: &str) -> bool

Source

pub(crate) fn peek_token_as_string(&self) -> String

Source

pub fn canonicalize_identifier(ident: Ident) -> Ident

Canonicalize the identifier to lowercase if it’s not quoted.

Source

pub(crate) fn canonicalize_object_name( object_name: ObjectName, ) -> Result<ObjectName>

Like [canonicalize_identifier] but for ObjectName.

Source

pub(crate) fn parse_object_name(&mut self) -> Result<ObjectName, ParserError>

Simply a shortcut for sqlparser’s same name method parse_object_name, but with constant argument “false”. Because the argument is always “false” for us (it’s introduced by BigQuery), we don’t want to write it again and again.

Source§

impl ParserContext<'_>

admin extension parser: admin function(arg1, arg2, ...) or admin function

Source

pub(crate) fn parse_admin_command(&mut self) -> Result<Statement>

Parse admin function(arg1, arg2, ...) or admin function statement

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_alter(&mut self) -> Result<Statement>

Source

fn parse_alter_database(&mut self) -> Result<AlterDatabase>

Source

fn parse_alter_table(&mut self) -> Result<AlterTable>

Source

fn parse_alter_table_unset(&mut self) -> Result<AlterTableOperation>

Source

fn parse_alter_table_repartition(&mut self) -> Result<AlterTableOperation>

Source

fn parse_alter_table_partition(&mut self) -> Result<AlterTableOperation>

Source

fn parse_alter_table_split_partition(&mut self) -> Result<AlterTableOperation>

Source

fn parse_optional_repartition_columns(&mut self) -> Result<Option<Vec<Ident>>>

Source

fn parse_alter_table_merge_partition(&mut self) -> Result<AlterTableOperation>

Source

fn parse_repartition_expr_list(&mut self) -> Result<Vec<Expr>>

Source

fn parse_alter_table_add(&mut self) -> Result<AlterTableOperation>

Source

fn parse_add_column(&mut self) -> Result<AddColumn>

Source

fn parse_alter_table_drop_default( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source

fn parse_alter_table_set_default( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source

fn parse_alter_table_modify(&mut self) -> Result<AlterTableOperation>

Source

fn parse_alter_column_unset_index( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source

fn parse_alter_column_set_index( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source

fn parse_alter_column_fulltext( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source

fn parse_alter_column_skipping( &mut self, column_name: Ident, ) -> Result<AlterTableOperation>

Source§

impl ParserContext<'_>

Source§

impl ParserContext<'_>

Source§

impl<'a> ParserContext<'a>

Parses create [table] statement

Source

pub(crate) fn parse_create(&mut self) -> Result<Statement>

Source

fn parse_create_view(&mut self, or_replace: bool) -> Result<Statement>

Parse CREAVE VIEW statement.

Source

fn parse_view_columns(&mut self) -> Result<Vec<Ident>>

Source

fn parse_create_external_table(&mut self) -> Result<Statement>

Source

fn parse_create_database(&mut self) -> Result<Statement>

Source

fn parse_create_table(&mut self) -> Result<Statement>

Source

fn parse_create_flow(&mut self, or_replace: bool) -> Result<Statement>

“CREATE FLOW” clause

Source

fn parse_flow_sql_or_tql(&mut self, require_now_expr: bool) -> Result<SqlOrTql>

Source

fn parse_interval_no_month(&mut self, context: &str) -> Result<i64>

Parse the interval expr to duration in seconds.

Source

fn parse_interval_no_month_whole_secs( &mut self, context: &str, ) -> Result<(i64, bool)>

Parses an interval that must not contain months and returns the total whole seconds together with whether the interval contains a sub-second fraction. Whole seconds are computed by truncating the nanosecond part; callers that require exact whole-second precision (e.g. EVAL OFFSET) must reject has_fractional_secs.

Source

fn consume_eval_pair(&mut self, second: &str) -> bool

Consumes an EVAL <keyword> token pair case-insensitively.

EVAL is not a sqlparser keyword, so a plain consume_tokens([Token::make_keyword("EVAL"), ...]) comparison would be case-sensitive on the word value and reject lower-case eval interval.

Source

fn parse_interval_month_day_nano( &mut self, ) -> Result<(IntervalMonthDayNano, String)>

Parse interval expr to [IntervalMonthDayNano].

Source

fn parse_if_not_exist(&mut self) -> Result<bool>

Source

fn parse_create_table_options(&mut self) -> Result<OptionMap>

Source

fn parse_partitions(&mut self) -> Result<Option<Partitions>>

“PARTITION ON COLUMNS (…)” clause

Source

pub(crate) fn parse_partition_on_columns(&mut self) -> Result<Partitions>

Parses the “ON COLUMNS (…) (…)” part after “PARTITION”.

Source

fn parse_partition_entry(&mut self) -> Result<Expr>

Source

fn parse_comma_separated<T, F>(&mut self, f: F) -> Result<Vec<T>>
where F: FnMut(&mut ParserContext<'a>) -> Result<T>,

Parse a comma-separated list wrapped by “()”, and of which all items accepted by F

Source

fn parse_columns(&mut self) -> Result<(Vec<Column>, Vec<TableConstraint>)>

Parse the columns and constraints.

Source

fn parse_column( &mut self, columns: &mut Vec<Column>, constraints: &mut Vec<TableConstraint>, ) -> Result<()>

Source

fn parse_column_name(&mut self) -> Result<Ident, ParserError>

Parse the column name and check if it’s valid.

Source

pub fn parse_column_def(&mut self, allow_keyword_name: bool) -> Result<Column>

Parses a column definition, optionally allowing unquoted keyword names for compatibility with ALTER TABLE ADD COLUMN.

Source

fn parse_optional_column_option( parser: &mut Parser<'_>, ) -> Result<Option<ColumnOption>>

Source

fn parse_column_extensions( parser: &mut Parser<'_>, column_name: &Ident, column_type: &DataType, column_extensions: &mut ColumnExtensions, ) -> Result<bool>

Parse a column option extensions.

This function will handle:

  • Vector type
  • Indexes
  • SST compression options
Source

fn parse_optional_table_constraint(&mut self) -> Result<Option<TableConstraint>>

Source

fn parse_table_engine(&mut self, default: &str) -> Result<String>

Parses the set of valid formats

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_declare_cursor(&mut self) -> Result<Statement>

Source

pub(crate) fn parse_fetch_cursor(&mut self) -> Result<Statement>

Source

pub(crate) fn parse_close_cursor(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_deallocate(&mut self) -> Result<String>

Parses MySQL style ‘PREPARE stmt_name’ into a stmt_name string.

Source§

impl ParserContext<'_>

DELETE statement parser implementation

Source

pub(crate) fn parse_delete(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

DESCRIBE statement parser implementation

Source

pub(crate) fn parse_describe(&mut self) -> Result<Statement>

Source

fn parse_describe_table(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

DROP statement parser implementation

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_mysql_execute(&mut self) -> Result<(String, Vec<Expr>)>

Parses MySQL style ‘EXECUTE stmt_name USING param_list’ into a stmt_name string and a list of parameters. Only use for MySQL. for PostgreSQL, use sqlparser::parser::Parser::parse_execute instead.

Source§

impl ParserContext<'_>

EXPLAIN statement parser implementation

Source

pub(crate) fn parse_explain(&mut self) -> Result<Statement>

explain that support use our own parser to parse the inner statement

Source§

impl ParserContext<'_>

INSERT/REPLACE statement parser implementation

Source

pub(crate) fn parse_insert(&mut self) -> Result<Statement>

Source

pub(crate) fn parse_replace(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_mysql_prepare(&mut self) -> Result<(String, String)>

Parses MySQL style ‘PREPARE stmt_name FROM stmt’ into a (stmt_name, stmt) tuple. Only use for MySQL. for PostgreSQL, use sqlparser::parser::Parser::parse_prepare instead.

Source§

impl ParserContext<'_>

Source

pub(crate) fn parse_query(&mut self) -> Result<Statement>

Parses select and it’s variants.

Source§

impl ParserContext<'_>

SET variables statement parser implementation

Source

pub(crate) fn parse_set_variables(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

SHOW statement parser implementation

Source

pub(crate) fn parse_show(&mut self) -> Result<Statement>

Parses SHOW statements todo(hl) support show settings/show create/show users etc.

Source

fn consume_variables_scope(&mut self)

Consumes the GLOBAL/SESSION/LOCAL scope MySQL accepts in front of VARIABLES and STATUS. GreptimeDB keeps no global/session split, so the scope is accepted and ignored.

Source

fn parse_show_create_database(&mut self) -> Result<Statement>

Source

fn parse_show_create_table(&mut self) -> Result<Statement>

Parse SHOW CREATE TABLE statement

Source

fn parse_show_create_flow(&mut self) -> Result<Statement>

Source

fn parse_show_create_view(&mut self) -> Result<Statement>

Source

fn parse_show_table_name(&mut self) -> Result<String>

Source

fn parse_db_name(&mut self) -> Result<Option<String>>

Source

fn parse_show_columns(&mut self, full: bool) -> Result<Statement>

Source

fn parse_show_kind(&mut self) -> Result<ShowKind>

Source

fn parse_show_index(&mut self) -> Result<Statement>

Source

fn parse_show_regions(&mut self) -> Result<Statement>

Source

fn parse_show_tables(&mut self, full: bool) -> Result<Statement>

Source

fn parse_show_table_status(&mut self) -> Result<Statement>

Source

pub fn parse_show_databases(&mut self, full: bool) -> Result<Statement>

Parses SHOW DATABASES statement.

Source

fn parse_show_views(&mut self) -> Result<Statement>

Source

fn parse_show_flows(&mut self) -> Result<Statement>

Source

fn parse_show_flow_status(&mut self) -> Result<Statement>

Source

fn parse_show_processlist(&mut self, full: bool) -> Result<Statement>

Source§

impl ParserContext<'_>

TQL extension parser, including:

  • TQL EVAL <query>
  • TQL EXPLAIN [VERBOSE] [FORMAT format] <query>
  • TQL ANALYZE [VERBOSE] [FORMAT format] <query>
Source

pub(crate) fn parse_tql(&mut self, require_now_expr: bool) -> Result<Statement>

Source

fn parse_tql_params( &mut self, require_now_expr: bool, ) -> Result<TqlParameters, TQLError>

require_now_expr indicates whether the start&end must contain a now() function.

Source

pub fn comma_or_rparen(token: &Token) -> bool

Source

fn is_comma(token: &Token) -> bool

Source

fn is_rparen(token: &Token) -> bool

Source

fn has_verbose_keyword(&mut self) -> bool

Source

fn parse_format_option(&mut self) -> Option<AnalyzeFormat>

Source

fn parse_expr_to_literal_or_ts( parser_expr: Expr, require_now_expr: bool, scheduled_time: Option<DateTime<Utc>>, ) -> Result<String, TQLError>

Parse the expression to a literal string or a timestamp in seconds.

Source

fn parse_expr_to_ts( parser_expr: Expr, require_now_expr: bool, scheduled_time: Option<DateTime<Utc>>, ) -> Result<String, TQLError>

Parse the expression to a timestamp in seconds.

Source

pub fn parse_tql_query( parser: &mut Parser<'_>, sql: &str, ) -> Result<(String, Option<String>), ParserError>

Parse the TQL query and optional alias from the given [Parser] and SQL string.

Source§

impl ParserContext<'_>

TRUNCATE [TABLE] table_name [FILE RANGE ...] [WITH (wait = ..., timeout = ...)];

Source

pub(crate) fn parse_truncate(&mut self) -> Result<Statement>

Source§

impl ParserContext<'_>

Parser implementation for hybrid WITH clauses containing TQL

Source

pub(crate) fn parse_with_tql(&mut self) -> Result<Statement>

Parse a WITH clause that may contain TQL CTEs or SQL CTEs.

Source

pub(crate) fn parse_with_tql_with_now( &mut self, require_now_expr: bool, ) -> Result<Statement>

Source

fn parse_hybrid_cte(&mut self, require_now_expr: bool) -> Result<HybridCte>

Parse a single CTE that can be either SQL or TQL

Source

fn parse_cte_content(&mut self, require_now_expr: bool) -> Result<CteContent>

Determine if CTE contains TQL or SQL and parse accordingly

Source

fn parse_tql_content_in_cte(&mut self, require_now_expr: bool) -> Result<Tql>

Parse TQL content within a CTE by extracting the raw query string.

This method consumes all tokens that belong to the TQL statement and stops right before the closing ) of the CTE so that the caller can handle it normally.

Only TQL EVAL is supported inside CTEs.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ParserContext<'a>

§

impl<'a> !Send for ParserContext<'a>

§

impl<'a> !Sync for ParserContext<'a>

§

impl<'a> !UnwindSafe for ParserContext<'a>

§

impl<'a> Freeze for ParserContext<'a>

§

impl<'a> Unpin for ParserContext<'a>

§

impl<'a> UnsafeUnpin for ParserContext<'a>

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
§

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

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<T> ErasedDestructor for T
where T: 'static,

§

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

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

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

§

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

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>
where Self: Sized,

Propagate a header from the request to the response. Read more
§

fn add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. Read more
§

fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>
where Self: Sized,

Apply a transformation to the request body. Read more
§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn compression(self) -> Compression<Self>
where Self: Sized,

Compresses response bodies. Read more
§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn sensitive_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>
where Self: Sized,

Mark headers as sensitive on both requests and responses. Read more
§

fn sensitive_request_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<Self>
where Self: Sized,

Mark headers as sensitive on requests. Read more
§

fn sensitive_response_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveResponseHeaders<Self>
where Self: Sized,

Mark headers as sensitive on responses. Read more
§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
§

fn set_request_id<M>( self, header_name: HeaderName, make_request_id: M, ) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension. Read more
§

fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension, using x-request-id as the header name. Read more
§

fn propagate_request_id( self, header_name: HeaderName, ) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses. Read more
§

fn propagate_x_request_id(self) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses, using x-request-id as the header name. Read more
§

fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

Catch panics and convert them into 500 Internal Server responses. Read more
§

fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>
where Self: Sized,

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more
§

fn trim_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Remove trailing slashes from paths. Read more
§

fn append_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Append trailing slash to paths. Read more
§

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