pub struct RangeArea<SegmentType: Segment> {
pub start: usize,
pub end: usize,
pub segment: SegmentType,
}
Fields§
§start: usize
§end: usize
§segment: SegmentType
Implementations§
Source§impl<SegmentType: Segment> RangeArea<SegmentType>
impl<SegmentType: Segment> RangeArea<SegmentType>
Sourcepub fn shrink_or_split_if_overlap(
&mut self,
start: usize,
end: usize,
args: ArgsType,
) -> DiffSet<SegmentType>
pub fn shrink_or_split_if_overlap( &mut self, start: usize, end: usize, args: ArgsType, ) -> DiffSet<SegmentType>
尝试空出[start, end)区间。即删除当前区间中和[start, end)相交的部分。
注意,这个函数在内部已经 unmap 了对应的区间中的映射,调用后不需要再手动 unmap。 这个函数默认参数中的 start 和 end 是按页对齐的
Sourcepub fn split_and_modify_if_overlap(
&mut self,
start: usize,
end: usize,
new_flag: IdentType,
args: ArgsType,
) -> CutSet<SegmentType>
pub fn split_and_modify_if_overlap( &mut self, start: usize, end: usize, new_flag: IdentType, args: ArgsType, ) -> CutSet<SegmentType>
尝试修改与 [start, end) 区间相交的部分的权限。 如果这一修改导致区间分裂,则分别返回分出的每个区间。
Sourcepub fn is_overlap_with(&self, start: usize, end: usize) -> bool
pub fn is_overlap_with(&self, start: usize, end: usize) -> bool
当前区间与 [start, end) 是否相交
Trait Implementations§
Auto Trait Implementations§
impl<SegmentType> Freeze for RangeArea<SegmentType>where
SegmentType: Freeze,
impl<SegmentType> RefUnwindSafe for RangeArea<SegmentType>where
SegmentType: RefUnwindSafe,
impl<SegmentType> Send for RangeArea<SegmentType>where
SegmentType: Send,
impl<SegmentType> Sync for RangeArea<SegmentType>where
SegmentType: Sync,
impl<SegmentType> Unpin for RangeArea<SegmentType>where
SegmentType: Unpin,
impl<SegmentType> UnwindSafe for RangeArea<SegmentType>where
SegmentType: UnwindSafe,
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