pub enum CapacityMorphError {
InvalidCapacity,
CannotShrinkInFlight {
in_flight: usize,
new_capacity: usize,
},
Ring(RingError),
Adaptive(AdaptiveError),
}Expand description
Errors returned by capacity-morph operations.
Variants§
InvalidCapacity
Target capacity is not a power of two, or is less than 2.
CannotShrinkInFlight
Never returned. Shrinks always succeed: in-flight items stay
physically in the old AdaptiveRing as part of the stale list
and the consumer drains them through try_recv’s stale-walk,
so there is nothing for a shrink to refuse. The variant is
part of the public enum and kept so matches stay exhaustive.
Ring(RingError)
Underlying ring allocation, push, or pop failed during the morph. The active backing is unchanged.
Adaptive(AdaptiveError)
Producer / consumer registration on the new backing failed (e.g. mirroring more peers than the configured max_producers / max_consumers).
Trait Implementations§
Source§impl Debug for CapacityMorphError
impl Debug for CapacityMorphError
Source§impl Display for CapacityMorphError
impl Display for CapacityMorphError
Source§impl Error for CapacityMorphError
impl Error for CapacityMorphError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AdaptiveError> for CapacityMorphError
impl From<AdaptiveError> for CapacityMorphError
Source§fn from(e: AdaptiveError) -> Self
fn from(e: AdaptiveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CapacityMorphError
impl RefUnwindSafe for CapacityMorphError
impl Send for CapacityMorphError
impl Sync for CapacityMorphError
impl Unpin for CapacityMorphError
impl UnsafeUnpin for CapacityMorphError
impl UnwindSafe for CapacityMorphError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more