Skip to main content

Provider

Trait Provider 

Source
pub trait Provider {
    // Required methods
    fn name(&self) -> &'static str;
    fn methods(&self) -> Vec<String>;
    fn mutating(&self, method: &str) -> bool;
    fn invoke(&mut self, object: u64, call: &Call) -> Result<Response>;

    // Provided methods
    fn has_method(&self, method: &str) -> bool { ... }
    fn on_drop(&mut self, _object: u64, _cap: CapId) { ... }
    fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)> { ... }
}
Expand description

A provider of capabilities: a module, a tool, a peer.

Required Methods§

Source

fn name(&self) -> &'static str

Stable adapter name.

Source

fn methods(&self) -> Vec<String>

Methods this provider answers (introspection).

Source

fn mutating(&self, method: &str) -> bool

Whether method mutates provider state (refused on read-only caps).

Source

fn invoke(&mut self, object: u64, call: &Call) -> Result<Response>

Invoke a method on object.

Provided Methods§

Source

fn has_method(&self, method: &str) -> bool

Whether this provider answers method.

Source

fn on_drop(&mut self, _object: u64, _cap: CapId)

Called when the last capability referencing object is dropped.

Source

fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>

Drain provider-side drop notifications recorded by Provider::on_drop.

The kernel owns providers, so tests and operators read the notifications through Agent::take_drops.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§