pub enum SplitDownResult {
Split {
low: AllocatedRange,
high: AllocatedRange,
},
High(AllocatedRange),
OutOfBounds(AllocatedRange),
}Expand description
Result of split_at_align_down
split_at_align_down 的返回结果
§Variants
Split: Successfully split into two non-empty ranges (low, high)High: Only high range exists (split point <= start)OutOfBounds: Position exceeds range length (pos > len)
§变体
Split: 成功拆分为两个非空范围 (low, high)High: 仅存在高范围(分割点 <= start)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)
High(AllocatedRange)
Only high range exists (split point aligned to or before start)
仅存在高范围(分割点对齐到 start 或之前)
OutOfBounds(AllocatedRange)
Position out of bounds (pos > len)
位置越界 (pos > len)
Implementations§
Source§impl SplitDownResult
impl SplitDownResult
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 if split succeeded
获取低范围(仅拆分成功时可用)
Sourcepub fn high(&self) -> Option<AllocatedRange>
pub fn high(&self) -> Option<AllocatedRange>
Get the high range (always available except OutOfBounds)
获取高范围(除 OutOfBounds 外始终可用)
Trait Implementations§
Source§impl Clone for SplitDownResult
impl Clone for SplitDownResult
Source§fn clone(&self) -> SplitDownResult
fn clone(&self) -> SplitDownResult
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 SplitDownResult
impl Debug for SplitDownResult
Source§impl PartialEq for SplitDownResult
impl PartialEq for SplitDownResult
impl Copy for SplitDownResult
impl Eq for SplitDownResult
impl StructuralPartialEq for SplitDownResult
Auto Trait Implementations§
impl Freeze for SplitDownResult
impl RefUnwindSafe for SplitDownResult
impl Send for SplitDownResult
impl Sync for SplitDownResult
impl Unpin for SplitDownResult
impl UnwindSafe for SplitDownResult
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