Skip to main content

Provider

Struct Provider 

Source
pub struct Provider {
Show 25 fields pub brand: String, pub client_id: String, pub client_secret: Option<String>, pub client_secret_file: Option<PathBuf>, pub issuer_url: Option<Url>, pub callback_url: Option<Url>, pub default: bool, pub name: Option<String>, pub icon: Option<OwnedMxcUri>, pub scope: BTreeSet<String>, pub userid_claims: BTreeSet<String>, pub trusted: bool, pub unique_id_fallbacks: bool, pub registration: bool, pub base_path: Option<String>, pub discovery_url: Option<Url>, pub authorization_url: Option<Url>, pub token_url: Option<Url>, pub revocation_url: Option<Url>, pub introspection_url: Option<Url>, pub userinfo_url: Option<Url>, pub discovery: bool, pub grant_session_duration: Option<u64>, pub check_cookie: bool, pub extra_authorization_parameters: BTreeMap<String, String>,
}

Fields§

§brand: String

The brand-name of the service (e.g. Apple, Facebook, GitHub, GitLab, Google) or the software (e.g. keycloak, MAS) providing the identity. When a brand is recognized we apply certain defaults to this config for your convenience. For certain brands we apply essential internal workarounds specific to that provider; it is important to configure this field properly when a provider needs to be recognized (like GitHub for example).

Several configured providers can share the same brand name. It is not case-sensitive. As a convenience for common simple deployments we can identify this provider by brand in addition to the unique client_id if and only if there is a single provider for the brand; see notes for client_id.

§client_id: String

The ID of your OAuth application which the provider generates upon registration. This ID then uniquely identifies this configuration instance itself, becoming the identity provider’s ID and must be unique and remain unchanged.

As a convenience we also identify this config by brand if and only if there is a single provider configured for a brand. Note carefully that multiple providers configured with the same brand is not an error and this provider will simply not be found when querying by brand.

§client_secret: Option<String>

Secret key the provider generated for you along with the client_id above. Unlike the client_id, the client_secret can be changed here whenever the provider regenerates one for you.

display: sensitive

§client_secret_file: Option<PathBuf>

Secret key to use that’s read from the file path specified.

This takes priority over “client_secret” first, and falls back to “client_secret” if invalid or failed to open.

example: “/etc/tuwunel/.client_secret”

§issuer_url: Option<Url>

Issuer URL the provider publishes for you. We have pre-supplied default values for some of the canonical public providers, making this field optional based on the brand set above. Otherwise it is required to find self-hosted providers. It must be identical to what is configured and expected by the provider and must never change because we associate identities to it. If the /.well-known/openid-configuration is not found behind this URL see base_path below as a workaround.

§callback_url: Option<Url>

The callback URL configured when registering the OAuth application with the provider. Tuwunel’s callback URL must be strictly formatted exactly as instructed. The URL host must point directly at the matrix server and use the following path: /_matrix/client/unstable/login/sso/callback/<client_id> where <client_id> is the same one configured for this provider above.

§default: bool

When more than one identity_provider has been configured and single_sso is false and sso_custom_providers_page is false this will determine the behavior of the /_matrix/client/v3/login/sso/redirect endpoint (note the url lacks a trailing client_id).

When only one identity_provider is configured it will be interpreted as the default and this does not need to be set. Otherwise a default must be selected for some clients (e.g. fluffychat) to work properly when the above conditions require it. To operate out-of-the-box we default to one configured provider if none are explicitly default; a warning will be logged on startup for this condition.

(EXPERIMENTAL) Multiple providers can be set to default. All providers configured with this option set to true will associate with the same Matrix account when a client flows through /_matrix/client/v3/login/sso/redirect.

When a user authorizes any provider configured default, the flow will include all other providers configured default as well for association. NOTE: authorization must succeed for ALL default providers.

§name: Option<String>

Optional display-name for this provider instance seen on the login page by users. It defaults to brand. When configuring multiple providers using the same brand this can be set to distinguish them.

§icon: Option<OwnedMxcUri>

Optional icon for the provider. The canonical providers have a default icon based on the brand supplied above when this is not supplied. Note that it uses an MXC url which is curious in the auth-media era and may not be reliable.

§scope: BTreeSet<String>

Optional list of scopes to authorize. An empty array does not impose any restrictions from here, effectively defaulting to all scopes you configured for the OAuth application at the provider. This setting allows for restricting to a subset of those scopes for this instance. Note the user can further restrict scopes during their authorization.

default: []

§userid_claims: BTreeSet<String>

Optional list of userinfo claims which shape and restrict the way we compute a Matrix UserId for new registrations. Reviewing Tuwunel’s documentation will be necessary for a complete description in detail. An empty array imposes no restriction here, avoiding generated fallbacks as much as possible.

For simplicity we reserve a claim called “unique” which can be listed alone to ensure only generated ID’s are used for registrations.

Note that listing the claim “sub” has special significance and will take precedence over all other claims, listed or unlisted. “sub” is not normally used to determine a UserId unless explicitly listed here.

As of now arbitrary claims cannot be listed here, we only recognize specific hard-coded claims.

default: []

§trusted: bool

Trusted providers can cause username conflicts (i.e. account hijacking) but this is precisely how an existing matrix account can be associated with a provider. When this option is set to true, the way we compute a Matrix UserId from userinfo claims is inverted: we find the first matching user and grant access to it. Whereas by default, when set to false, we skip matching users and register the first available username; falling-back to random characters to avoid conflicts.

Only set this option to true for providers you self-host and control. Never set this option to true for the public providers such as GitHub, GitLab, etc.

Note that associating an existing user with an untrusted provider is still possible but only with the command ‘!admin query oauth associate’.

default: false

§unique_id_fallbacks: bool

Setting this option to false will inhibit unique ID’s from being generated as a last-resort when determining a UserId from a provider’s claims. In the case of untrusted providers, when all provided claims conflict with existing user accounts, a unique fallback ID needs to be generated for registration to not be denied with an error.

Set this option to false if you operate a private server or a trusted identity provider where random UserId’s are undesirable; the result of a misconfiguration or other issue where an error is warranted.

This option should be set to true for public servers or some users may never be able to register.

default: true

§registration: bool

Controls whether new user registration is possible from this provider. When this option is set to false, authorizations from this provider only affect existing users and will never result in a new registration when the claims fail to match any existing user (in the case of trusted providers) or an available username is found (in the case of untrusted providers).

Setting this option to false is generally not useful unless there is an explicit reason to do so.

default: true

§base_path: Option<String>

Optional extra path components after the issuer_url leading to the location of the .well-known directory used for discovery. If the path starts with a slash it will be treated as absolute, meaning overwriting any path in the issuer_url. The path needs to end with a slash. This will be empty for specification-compliant providers. We have supplied any known values based on brand (e.g. login/oauth/ for GitHub).

§discovery_url: Option<Url>

Overrides the .well-known location where the provider’s openid configuration is found. It is very unlikely you will need to set this; available for developers or special purposes only.

§authorization_url: Option<Url>

Overrides the authorize URL requested during the grant phase. This is generally discovered or derived automatically, but may be required as a workaround for any non-standard or undiscoverable provider.

§token_url: Option<Url>

Overrides the access token URL; the same caveats apply as with the other URL overrides.

§revocation_url: Option<Url>

Overrides the revocation URL; the same caveats apply as with the other URL overrides.

§introspection_url: Option<Url>

Overrides the introspection URL; the same caveats apply as with the other URL overrides.

§userinfo_url: Option<Url>

Overrides the userinfo URL; the same caveats apply as with the other URL overrides.

§discovery: bool

Whether to perform discovery and adjust this provider’s configuration accordingly. This defaults to true. When true, it is an error when discovery fails and authorizations will not be attempted to the provider.

§grant_session_duration: Option<u64>

The duration in seconds before a grant authorization session expires.

default: 300

§check_cookie: bool

Whether to check the redirect cookie during the callback. This is a security feature and should remain enabled. This is available for developers or deployments which cannot tolerate cookies and are willing to tolerate the risks.

default: true

§extra_authorization_parameters: BTreeMap<String, String>

Extra query parameters appended to every authorization request sent to the identity provider.

E.g. to force re-authentication even if IdP cookies are present:

[[global.identity_provider]]
extra_authorization_parameters = { prompt = "login" }

default: {}

Implementations§

Source§

impl IdentityProvider

Source

pub fn id(&self) -> &str

Source

pub async fn get_client_secret(&self) -> Result<String, Error>

Trait Implementations§

Source§

impl Clone for IdentityProvider

Source§

fn clone(&self) -> IdentityProvider

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IdentityProvider

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for IdentityProvider

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<IdentityProvider, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for IdentityProvider

Source§

fn fmt(&self, out: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> DropFlavorWrapper<T> for T

§

type Flavor = MayDrop

The DropFlavor that [wrap]s T into Self
Source§

impl<T> ExpectInto for T

Source§

fn expect_into<Dst>(self) -> Dst
where Dst: TryFrom<Self>, Self: Sized,

Source§

impl<T> Expected for T

Source§

fn expected_add(self, rhs: Self) -> Self
where Self: Sized + CheckedAdd,

Source§

fn expected_sub(self, rhs: Self) -> Self
where Self: Sized + CheckedSub,

Source§

fn expected_mul(self, rhs: Self) -> Self
where Self: Sized + CheckedMul,

Source§

fn expected_div(self, rhs: Self) -> Self
where Self: Sized + CheckedDiv,

Source§

fn expected_rem(self, rhs: Self) -> Self
where Self: Sized + CheckedRem,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

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

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

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

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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 add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. 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 catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T> Tried for T

Source§

fn try_add(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedAdd,

Source§

fn try_sub(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedSub,

Source§

fn try_mul(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedMul,

Source§

fn try_div(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedDiv,

Source§

fn try_rem(self, rhs: Self) -> Result<Self, Error>
where Self: Sized + CheckedRem,

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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> JsonCastable<CanonicalJsonValue> for T

§

impl<T> JsonCastable<Value> for T