Skip to main content

OAuthProvider

Struct OAuthProvider 

Source
pub struct OAuthProvider {
Show 25 fields pub uuid: Uuid, pub name: CompactString, pub description: Option<CompactString>, pub client_id: CompactString, pub client_secret: Option<EncryptedString>, pub auth_url: String, pub token_url: String, pub info_url: String, pub info_urls: IndexMap<CompactString, String>, pub scopes: Vec<CompactString>, pub identifier_path: String, pub email_path: Option<String>, pub username_path: Option<String>, pub name_first_path: Option<String>, pub name_last_path: Option<String>, pub avatar_url_template: Option<String>, pub avatar_overwrite: bool, pub enabled: bool, pub login_only: bool, pub login_bypass_two_factor: bool, pub link_viewable: bool, pub user_manageable: bool, pub basic_auth: bool, pub pkce: bool, pub created: NaiveDateTime, /* private fields */
}

Fields§

§uuid: Uuid§name: CompactString§description: Option<CompactString>§client_id: CompactString§client_secret: Option<EncryptedString>§auth_url: String§token_url: String§info_url: String§info_urls: IndexMap<CompactString, String>§scopes: Vec<CompactString>§identifier_path: String§email_path: Option<String>§username_path: Option<String>§name_first_path: Option<String>§name_last_path: Option<String>§avatar_url_template: Option<String>§avatar_overwrite: bool§enabled: bool§login_only: bool§login_bypass_two_factor: bool§link_viewable: bool§user_manageable: bool§basic_auth: bool§pkce: bool§created: NaiveDateTime

Implementations§

Source§

impl OAuthProvider

Source

pub async fn fetch_info( &self, client: &Client, access_token: &str, ) -> Result<OAuthProviderInfo, Error>

Fetches the info url and every additional info url with the user’s access token.

An additional info url responding with 404 is left out of the sources, so matchers on it fail as for a user outside of e.g. a discord guild. Any other failure aborts, since mappings revoking on a transient error would strip access the user still has.

Source

pub async fn all_with_pagination( database: &Database, page: i64, per_page: i64, search: Option<&str>, ) -> Result<Pagination<Self>, DatabaseError>

Source

pub async fn exists_usable_except( database: &Database, except: Option<Uuid>, ) -> Result<bool, Error>

Source

pub async fn all_by_usable( database: &Database, ) -> Result<Vec<Self>, DatabaseError>

Source

pub fn extract_identifier(&self, value: &Value) -> Result<String, Error>

Source

pub fn extract_email(&self, value: &Value) -> Result<String, Error>

Source

pub fn extract_username(&self, value: &Value) -> Result<String, Error>

Source

pub fn extract_name_first(&self, value: &Value) -> Result<Option<String>, Error>

Source

pub fn extract_name_last(&self, value: &Value) -> Result<Option<String>, Error>

Source

pub fn extract_avatar_url(&self, value: &Value) -> Result<Option<String>, Error>

Resolves avatar_url_template against a provider’s user info response, substituting every {$.json.path} placeholder with the value found at that path.

A template that is nothing but a single placeholder yields that value verbatim, for the providers that hand back a whole avatar url ({$.picture}). Anywhere else the placeholder stands for one path or query component and its value is percent-encoded, so that a provider returning a crafted value cannot rewrite the rest of the url (https://cdn.discordapp.com/avatars/{$.id}/{$.avatar}.png).

Yields None when no template is configured or when any placeholder resolves to nothing, which is the ordinary “this user has no avatar” case rather than an error.

Source

pub async fn discover( state: &State, url: &Url, ) -> Result<DiscoveredOAuthProvider, Error>

Fetches an OpenID Connect discovery document and derives provider settings from it.

url may be either the issuer or the full /.well-known/openid-configuration url. Claim paths are only filled in when the provider advertises the claim, as a configured path that is missing from the userinfo response fails the login.

Trait Implementations§

Source§

impl BaseModel for OAuthProvider

Source§

const NAME: &'static str = "oauth_provider"

Source§

fn get_extension_list() -> &'static ModelExtensionList

Source§

fn get_extension_data(&self) -> &ModelExtensionData

Source§

fn base_columns(prefix: Option<&str>) -> BTreeMap<&'static str, CompactString>

Source§

fn map(prefix: Option<&str>, row: &PgRow) -> Result<Self, DatabaseError>

Source§

fn cache_invalidation_keys(&self) -> Vec<CompactString>

Source§

fn register_model_extension( extension: impl ModelExtension + Send + Sync + 'static, )

Registers a model extension. If an extension with the same name is already registered, this function will do nothing.
Source§

fn parse_model_extension<Extension: SafeModelExtension>( &self, ) -> Result<Extension::Value, DatabaseError>
where Extension::Value: Serialize + DeserializeOwned,

Parses a model extension from the model’s extension data. If the extension is not found, or if the data cannot be deserialized, an error is returned. Read more
Source§

fn columns(prefix: Option<&str>) -> BTreeMap<&'static str, CompactString>

Source§

fn columns_sql(prefix: Option<&str>) -> CompactString

Source§

fn map_extensions( prefix: &str, row: &PgRow, ) -> Result<ModelExtensionData, DatabaseError>

Source§

impl ByUuid for OAuthProvider

Source§

fn by_uuid<'life0, 'async_trait>( database: &'life0 Database, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn by_uuid_with_transaction<'life0, 'life1, 'async_trait>( transaction: &'life0 mut Transaction<'life1, Postgres>, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn by_uuid_cached<'life0, 'async_trait>( database: &'life0 Database, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source§

fn by_uuid_optional<'life0, 'async_trait>( database: &'life0 Database, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, DatabaseError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source§

fn by_uuid_optional_with_transaction<'life0, 'life1, 'async_trait>( transaction: &'life0 mut Transaction<'life1, Postgres>, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, DatabaseError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn by_uuid_optional_cached<'life0, 'async_trait>( database: &'life0 Database, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source§

fn get_fetchable(uuid: Uuid) -> Fetchable<Self>

Source§

fn get_fetchable_from_row( row: &PgRow, column: impl AsRef<str>, ) -> Option<Fetchable<Self>>

Source§

fn invalidate_cached<'life0, 'async_trait>( database: &'life0 Database, uuid: Uuid, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source§

impl Clone for OAuthProvider

Source§

fn clone(&self) -> OAuthProvider

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 CreatableModel for OAuthProvider

Source§

type CreateOptions<'a> = CreateOAuthProviderOptions

Source§

type CreateResult = OAuthProvider

Source§

fn get_create_handlers() -> &'static LazyLock<CreateListenerList<Self>>

Source§

fn create_with_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( state: &'life0 State, options: Self::CreateOptions<'life1>, transaction: &'life2 mut Transaction<'life3, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn register_create_handler<F: for<'a> Fn(&'a mut Self::CreateOptions<'_>, &'a mut InsertQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn register_after_create_handler<F: for<'a> Fn(&'a mut Self::CreateResult, &'a Self::CreateOptions<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn run_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( options: &'life0 mut Self::CreateOptions<'life1>, query_builder: &'life2 mut InsertQueryBuilder<'_>, state: &'life3 State, transaction: &'life4 mut Transaction<'life5, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source§

fn run_after_create_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( result: &'life0 mut Self::CreateResult, options: &'life1 Self::CreateOptions<'life2>, state: &'life3 State, transaction: &'life4 mut Transaction<'life5, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source§

fn create<'life0, 'life1, 'async_trait>( state: &'life0 State, options: Self::CreateOptions<'life1>, ) -> Pin<Box<dyn Future<Output = Result<Self::CreateResult, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl DeletableModel for OAuthProvider

Source§

type DeleteOptions = ()

Source§

fn get_delete_handlers() -> &'static LazyLock<DeleteHandlerList<Self>>

Source§

fn delete_with_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 State, options: Self::DeleteOptions, transaction: &'life2 mut Transaction<'life3, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn register_delete_handler<F: for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn register_after_delete_handler<F: for<'a> Fn(&'a Self, &'a Self::DeleteOptions, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn run_delete_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, options: &'life1 Self::DeleteOptions, state: &'life2 State, transaction: &'life3 mut Transaction<'life4, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source§

fn run_after_delete_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, options: &'life1 Self::DeleteOptions, state: &'life2 State, transaction: &'life3 mut Transaction<'life4, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source§

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 State, options: Self::DeleteOptions, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<'de> Deserialize<'de> for OAuthProvider

Source§

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

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

impl DuplicableModel for OAuthProvider

Source§

type DuplicateOptions<'a> = DuplicateOAuthProviderOptions

Source§

type DuplicateResult = OAuthProvider

Source§

fn get_duplicate_handlers() -> &'static LazyLock<DuplicateHandlerList<Self>>

Source§

fn duplicate_with_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 State, options: Self::DuplicateOptions<'life2>, transaction: &'life3 mut Transaction<'life4, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<Self, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source§

fn register_duplicate_handler<F: for<'a> Fn(&'a Self, &'a Self::DuplicateOptions<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn register_after_duplicate_handler<F: for<'a> Fn(&'a Self, &'a mut Self::DuplicateResult, &'a Self::DuplicateOptions<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn run_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, options: &'life1 Self::DuplicateOptions<'life2>, state: &'life3 State, transaction: &'life4 mut Transaction<'life5, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source§

fn run_after_duplicate_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, duplicated: &'life1 mut Self::DuplicateResult, options: &'life2 Self::DuplicateOptions<'life3>, state: &'life4 State, transaction: &'life5 mut Transaction<'life6, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

Source§

fn duplicate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 State, options: Self::DuplicateOptions<'life2>, ) -> Pin<Box<dyn Future<Output = Result<Self::DuplicateResult, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl IntoAdminApiObject for OAuthProvider

Source§

type AdminApiObject = AdminApiOAuthProvider

Source§

type ExtraArgs<'a> = ()

Source§

fn into_admin_api_object<'a, 'life0, 'async_trait>( self, state: &'life0 State, _args: Self::ExtraArgs<'a>, ) -> Pin<Box<dyn Future<Output = Result<Self::AdminApiObject, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

impl IntoApiObject for OAuthProvider

Source§

type ApiObject = ApiOAuthProvider

Source§

type ExtraArgs<'a> = ()

Source§

fn into_api_object<'a, 'life0, 'async_trait>( self, state: &'life0 State, _args: Self::ExtraArgs<'a>, ) -> Pin<Box<dyn Future<Output = Result<Self::ApiObject, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

impl Serialize for OAuthProvider

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl UpdatableModel for OAuthProvider

Source§

type UpdateOptions = UpdateOAuthProviderOptions

Source§

fn get_update_handlers() -> &'static LazyLock<UpdateHandlerList<Self>>

Source§

fn update_with_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, state: &'life1 State, options: Self::UpdateOptions, transaction: &'life2 mut Transaction<'life3, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn register_update_handler<F: for<'a> Fn(&'a mut Self, &'a mut Self::UpdateOptions, &'a mut UpdateQueryBuilder<'_>, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn register_after_update_handler<F: for<'a> Fn(&'a mut Self, &'a State, &'a mut Transaction<'_, Postgres>) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'a>> + Send + Sync + 'static>( priority: ListenerPriority, callback: F, )

Source§

fn run_update_handlers<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 mut self, options: &'life1 mut Self::UpdateOptions, query_builder: &'life2 mut UpdateQueryBuilder<'_>, state: &'life3 State, transaction: &'life4 mut Transaction<'life5, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source§

fn run_after_update_handlers<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, state: &'life1 State, transaction: &'life2 mut Transaction<'life3, Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn update<'life0, 'life1, 'async_trait>( &'life0 mut self, state: &'life1 State, options: Self::UpdateOptions, ) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Conv for T

§

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

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

§

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

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