Skip to main content

Directory

Trait Directory 

Source
pub trait Directory: Send + Sync {
    // Required method
    fn lookup(&self, lookup: Lookup) -> Result<Option<Person>, ProviderError>;

    // Provided method
    fn describe(&self) -> Result<Description, ProviderError> { ... }
}
Expand description

Resolves an authenticated reference into the authoritative Person record.

Required Methods§

Source

fn lookup(&self, lookup: Lookup) -> Result<Option<Person>, ProviderError>

Returns the person for lookup, or None when the reference is unknown or the account is disabled.

Provided Methods§

Source

fn describe(&self) -> Result<Description, ProviderError>

What this directory is. Defaults to nothing said.

Trait Implementations§

Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl Kind for dyn Directory

Source§

const NAME: &'static str = "coqui_directory"

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 = DirectoryVtable::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 = DirectoryVtable

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 Directory for Instance<dyn Directory>

Source§

fn lookup(&self, lookup: Lookup) -> Result<Option<Person>, ProviderError>

Source§

fn describe(&self) -> Result<Description, ProviderError>

Source§

impl Directory for Remote<dyn Directory>

Source§

fn lookup(&self, lookup: Lookup) -> Result<Option<Person>, ProviderError>

Source§

fn describe(&self) -> Result<Description, ProviderError>

Implementors§