pub struct SlotRange {
pub start: u16,
pub end: u16,
}Expand description
A contiguous range of slots assigned to a node.
§Invariants
A valid SlotRange always satisfies start <= end, meaning it contains
at least one slot. This is enforced by debug assertions in the constructor.
Fields§
§start: u16§end: u16Implementations§
Source§impl SlotRange
impl SlotRange
Sourcepub fn try_new(start: u16, end: u16) -> Result<Self, Error>
pub fn try_new(start: u16, end: u16) -> Result<Self, Error>
Creates a new slot range with runtime validation.
Returns an error if start > end or end >= SLOT_COUNT.
Use this for untrusted input (e.g. network-decoded data).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SlotRange
impl<'de> Deserialize<'de> for SlotRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for SlotRange
impl Eq for SlotRange
impl StructuralPartialEq for SlotRange
Auto Trait Implementations§
impl Freeze for SlotRange
impl RefUnwindSafe for SlotRange
impl Send for SlotRange
impl Sync for SlotRange
impl Unpin for SlotRange
impl UnsafeUnpin for SlotRange
impl UnwindSafe for SlotRange
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