pub trait Toggle: Sized + Sealed {
type Or<T: Toggle>: Toggle;
type And<T: Toggle>: Toggle;
// Required method
fn try_create() -> Option<Self>;
// Provided method
fn create() -> Self { ... }
}Expand description
A sealed trait for type-level booleans used to track pull capabilities.
Toggle is used to statically encode whether a pull can pend (CanPend) or end (CanEnd).
This enables compile-time guarantees about pull behavior and allows the type system to
optimize away impossible code paths.
Required Associated Types§
Required Methods§
Sourcefn try_create() -> Option<Self>
fn try_create() -> Option<Self>
Attempts to create this type, returning Err(()) if Self is No.
Provided Methods§
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.