Skip to main content

Accounts

Trait Accounts 

Source
pub trait Accounts: Send + Sync {
    // Required methods
    fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>;
    fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>;
    fn remove(&self, name: String) -> Result<(), ProviderError>;

    // Provided method
    fn waiting(&self) -> Result<Vec<Waiting>, ProviderError> { ... }
}
Expand description

Account management for a provider that keeps its own accounts.

A separate kind, so authentication providers that keep nothing (an LDAP client, a reverse-proxy header reader) do not implement it. A provider offering this kind is usually also an Authenticator and a Directory over the same store.

Required Methods§

Source

fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>

The accounts kept, without anything that proves one.

Source

fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>

Makes an account, or changes the one of that name; a field not said is left as it is. A provider that makes secrets itself answers with the one it made.

Source

fn remove(&self, name: String) -> Result<(), ProviderError>

Takes an account away. GUATIAO_ERR_NOT_FOUND when none has that name.

Provided Methods§

Source

fn waiting(&self) -> Result<Vec<Waiting>, ProviderError>

What was shown lately and is nobody’s yet, and could be accepted as somebody’s with put: a peer certificate nobody has accepted. Empty for a provider that keeps no such thing.

Trait Implementations§

Source§

impl From<Instance<dyn Accounts>> for Box<dyn Accounts>

Source§

fn from(instance: Instance<dyn Accounts>) -> Self

Converts to this type from the input type.
Source§

impl From<Remote<dyn Accounts>> for Box<dyn Accounts>

Source§

fn from(remote: Remote<dyn Accounts>) -> Self

Converts to this type from the input type.
Source§

impl Kind for dyn Accounts

Source§

const NAME: &'static str = "coqui_accounts"

The kind’s name in a descriptor’s kinds and tables.
Source§

const FLOOR: usize

The size of [Kind::Vtable]: every slot. A table declaring less is refused; a larger one has slots appended after these.
Source§

const FLOOR_HASH: u32 = AccountsVtable::FLOOR_HASH

FNV-1a over the shape and every method’s name and normalised signature, in table order. A table carrying another number was built from a different declaration of this kind. Read more
Source§

const REQUIRED: &'static [(&'static str, usize)]

Every required slot as (method name, one past its end), so a null one is refused by name.
Source§

const OBJECT: bool = false

Whether this is an object kind (#[guatiao::kind(object)]): a handle one caller owns, with a destroy slot first and &mut self methods, never offered by a registry. See [Object]. Read more
Source§

type Vtable = AccountsVtable

The repr(C) table, which starts with a [KindHeader].
Source§

fn as_dyn(remote: &Remote<Self>) -> &Self

The trait object over a proxy. The macro writes remote, because only it knows the trait.
Source§

fn as_dyn_mut(remote: &mut Remote<Self>) -> &mut Self

The same, mutably — what an [Object] hands out.
Source§

fn boxed(remote: Remote<Self>) -> Box<Self>

The same, boxed.
Source§

fn shared(remote: Remote<Self>) -> Arc<Self> ⓘ

The same, shared.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Accounts for Instance<dyn Accounts>

Source§

fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>

Source§

fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>

Source§

fn remove(&self, name: String) -> Result<(), ProviderError>

Source§

fn waiting(&self) -> Result<Vec<Waiting>, ProviderError>

Source§

impl Accounts for Remote<dyn Accounts>

Source§

fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>

Source§

fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>

Source§

fn remove(&self, name: String) -> Result<(), ProviderError>

Source§

fn waiting(&self) -> Result<Vec<Waiting>, ProviderError>

Implementors§