pub trait TargetKey: Sealed {
// Required methods
fn untyped(&self) -> IoTargetKey;
fn declared(&self) -> Option<Access>;
// Provided method
fn admitted_by(&self, actual: Access) -> Result<(), AddTargetCause> { ... }
}Expand description
A key a target can be registered under: IoTargetKey, which declares nothing, or a Key<A>,
which declares the access A names. Sealed, so that no other type can stand for a key that has
not been checked against what it claims.
Required Methods§
Sourcefn untyped(&self) -> IoTargetKey
fn untyped(&self) -> IoTargetKey
The number the ring addresses the target by.
Provided Methods§
Sourcefn admitted_by(&self, actual: Access) -> Result<(), AddTargetCause>
fn admitted_by(&self, actual: Access) -> Result<(), AddTargetCause>
Whether a target that states actual may be registered under this key: a declaration the
target covers, or none. What it refuses is the cause to report.
§Errors
AddTargetCause::AccessNotCovered when the key declares more than actual can do.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".