Skip to main content

Bindings

Trait Bindings 

Source
pub trait Bindings {
    // Required method
    fn binding(
        &self,
        fn_name: &str,
        asof: &str,
    ) -> Result<Option<Arc<Bound>>, ErrorCode>;

    // Provided methods
    fn cached(&self, fn_hash: &str, rest: &str) -> Option<Arc<Target>> { ... }
    fn remember(&self, rest: &str, target: &Arc<Target>) { ... }
    fn pinned(&self, fn_hash: &str) -> Result<Option<Arc<Bound>>, ErrorCode> { ... }
    fn alias(&self, alias: &str) -> Option<String> { ... }
    fn class(
        &self,
        name: &str,
        asof: &str,
    ) -> Result<Option<Arc<BoundClass>>, ErrorCode> { ... }
    fn aliases_tx(&self) -> Option<String> { ... }
    fn lookup(
        &self,
        class: &str,
        label: &str,
        asof: &str,
    ) -> Result<Option<String>, ErrorCode> { ... }
    fn class_name_of(
        &self,
        class_hash: &str,
        asof: &str,
    ) -> Result<Option<String>, ErrorCode> { ... }
    fn class_by_hash(
        &self,
        class_hash: &str,
    ) -> Result<Option<ClassDescriptor>, ErrorCode> { ... }
    fn chain(
        &self,
        cell: &CellRef,
        asof: &str,
    ) -> Result<Option<String>, ErrorCode> { ... }
}
Expand description

Where names are looked up: the mesh’s store (and, for names under other hosts, the cross-mesh resolver in front of it).

Required Methods§

Source

fn binding( &self, fn_name: &str, asof: &str, ) -> Result<Option<Arc<Bound>>, ErrorCode>

The binding of fn_name as of asof; Ok(None) when it has none. An Err is the code of an error envelope (the store or another mesh failed).

Provided Methods§

Source

fn cached(&self, fn_hash: &str, rest: &str) -> Option<Arc<Target>>

A target resolved before for the cell URI rest rest under function hash fn_hash (parsing depends on nothing else). Provided: none.

Source

fn remember(&self, rest: &str, target: &Arc<Target>)

Remembers a resolved target for Bindings::cached. Provided: nothing.

Source

fn pinned(&self, fn_hash: &str) -> Result<Option<Arc<Bound>>, ErrorCode>

The descriptor whose function hash is fn_hash (a pin, spec-0.4.2), as a binding of no time (since empty); Ok(None) when the mesh has none. Provided: none.

Source

fn alias(&self, alias: &str) -> Option<String>

The fully qualified name an alias (without @) stands for. Provided: none.

Source

fn class( &self, name: &str, asof: &str, ) -> Result<Option<Arc<BoundClass>>, ErrorCode>

The class name is bound to as of asof (spec-0.5.0, 9.7, 16.3); Ok(None) when it is not a class (a function name, or unbound). Provided: none.

Source

fn aliases_tx(&self) -> Option<String>

The instant of the alias snapshot Bindings::alias answers from, for resolved.aliases_tx (16.7); None when there is none (the configured map has no snapshot). Provided: none.

Source

fn lookup( &self, class: &str, label: &str, asof: &str, ) -> Result<Option<String>, ErrorCode>

The key encoding the lookup method of class class maps label to as of asof (16.7, D93): the value of the cell <class>/<lookup>(label: ...). Ok(None) when the class has no lookup or the cell has no value. Provided: none.

Source

fn class_name_of( &self, class_hash: &str, asof: &str, ) -> Result<Option<String>, ErrorCode>

The first name the class hash is bound to as of asof (K5, the classes round): the name that names the defining class of an inherited method, as super names its parent (16.3). Provided: none.

Source

fn class_by_hash( &self, class_hash: &str, ) -> Result<Option<ClassDescriptor>, ErrorCode>

The flattened class descriptor held under this class hash, bound or not (K5). Provided: none.

Source

fn chain(&self, cell: &CellRef, asof: &str) -> Result<Option<String>, ErrorCode>

The key encoding a chain’s cell holds as of asof (K10, the classes round): the value of the cell cell (computed or stored), None when it has no value then. Provided: none.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§