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§
Provided Methods§
Sourcefn has_method(&self, method: &str) -> bool
fn has_method(&self, method: &str) -> bool
Whether this provider answers method.
Sourcefn on_drop(&mut self, _object: u64, _cap: CapId)
fn on_drop(&mut self, _object: u64, _cap: CapId)
Called when the last capability referencing object is dropped.
Sourcefn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>
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".