pub trait IsolationHelper: Sized {
// Required methods
fn compatible_same_type(&self, other: &Self) -> bool;
fn join_same_type(&self, other: &Self) -> Option<Self>;
}
Expand description
Trait to help implement Isolation
.
You should generally implement this trait whenever you need to implement a new set of stream isolation rules: it takes care of down-casting and type checking for you.
When you implement this trait for some type T, isolation objects of that type will be incompatible (unable to share circuits) with objects of any other type. (That’s usually what you want; if you’re defining a new type of Isolation rules, then you probably don’t want streams using different rules to share circuits with yours.)
Required Methods§
Sourcefn compatible_same_type(&self, other: &Self) -> bool
fn compatible_same_type(&self, other: &Self) -> bool
Returns whether self and other are compatible.
Two streams may share a circuit if and only if they have compatible
Isolation
s.
(See Isolation::compatible
for more information and requirements.)
Sourcefn join_same_type(&self, other: &Self) -> Option<Self>
fn join_same_type(&self, other: &Self) -> Option<Self>
Join self and other into the intersection of what they allows.
(See Isolation::join
for more information and requirements.)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.