pub enum SplitUpResult {
Split {
low: AllocatedRange,
high: AllocatedRange,
},
Low(AllocatedRange),
OutOfBounds(AllocatedRange),
}Expand description
Result of split_at_align_up
split_at_align_up 的返回结果
§Variants
Split: Successfully split into two non-empty ranges (low, high)Low: Only low range exists (split point >= end)OutOfBounds: Position exceeds range length (pos > len)
§变体
Split: 成功拆分为两个非空范围 (low, high)Low: 仅存在低范围(分割点 >= end)OutOfBounds: 位置超出范围长度 (pos > len)
Variants§
Split
Successfully split into two ranges
成功拆分为两个范围
Fields
§
low: AllocatedRangeLower range [start, split_point)
低范围 [start, split_point)
§
high: AllocatedRangeHigher range [split_point, end)
高范围 [split_point, end)
Low(AllocatedRange)
Only low range exists (split point aligned to or beyond end)
仅存在低范围(分割点对齐到 end 或超出)
OutOfBounds(AllocatedRange)
Position out of bounds (pos > len)
位置越界 (pos > len)
Implementations§
Source§impl SplitUpResult
impl SplitUpResult
Sourcepub fn is_split(&self) -> bool
pub fn is_split(&self) -> bool
Returns true if the range was successfully split into two parts
如果范围成功拆分为两部分则返回 true
Sourcepub fn is_out_of_bounds(&self) -> bool
pub fn is_out_of_bounds(&self) -> bool
Returns true if position was out of bounds
如果位置越界则返回 true
Sourcepub fn low(&self) -> Option<AllocatedRange>
pub fn low(&self) -> Option<AllocatedRange>
Get the low range (always available except OutOfBounds)
获取低范围(除 OutOfBounds 外始终可用)
Sourcepub fn high(&self) -> Option<AllocatedRange>
pub fn high(&self) -> Option<AllocatedRange>
Get the high range if split succeeded
获取高范围(仅拆分成功时可用)
Trait Implementations§
Source§impl Clone for SplitUpResult
impl Clone for SplitUpResult
Source§fn clone(&self) -> SplitUpResult
fn clone(&self) -> SplitUpResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SplitUpResult
impl Debug for SplitUpResult
Source§impl PartialEq for SplitUpResult
impl PartialEq for SplitUpResult
impl Copy for SplitUpResult
impl Eq for SplitUpResult
impl StructuralPartialEq for SplitUpResult
Auto Trait Implementations§
impl Freeze for SplitUpResult
impl RefUnwindSafe for SplitUpResult
impl Send for SplitUpResult
impl Sync for SplitUpResult
impl Unpin for SplitUpResult
impl UnwindSafe for SplitUpResult
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