Struct FoldRegionId
pub struct FoldRegionId(pub u64);Expand description
Packed identity for a fold region’s line range.
The representation is collision-free when both line indices fit in 32 bits.
Values outside that range are not rejected and can collide, so persistent
callers should keep both inputs at or below u32::MAX.
§Examples
use ailloli_ui_editor::FoldRegionId;
assert_eq!(FoldRegionId::from_lines(2, 9), FoldRegionId((2_u64 << 32) | 9));Tuple Fields§
§0: u64Implementations§
§impl FoldRegionId
Creates packed fold-region identifiers.
impl FoldRegionId
Creates packed fold-region identifiers.
pub fn from_lines(start_line: usize, end_line: usize) -> FoldRegionId
pub fn from_lines(start_line: usize, end_line: usize) -> FoldRegionId
Packs the start line into the high 32 bits and ORs in the end line.
Inputs are not range-checked. The identifier is uniquely reversible
only when both inputs fit in u32.
§Examples
use ailloli_ui_editor::FoldRegionId;
let id = FoldRegionId::from_lines(12, 34);
assert_eq!(id.0 >> 32, 12);
assert_eq!(id.0 as u32, 34);Trait Implementations§
§impl Clone for FoldRegionId
impl Clone for FoldRegionId
§fn clone(&self) -> FoldRegionId
fn clone(&self) -> FoldRegionId
Returns a copy 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 more§impl Debug for FoldRegionId
impl Debug for FoldRegionId
§impl<'de> Deserialize<'de> for FoldRegionId
impl<'de> Deserialize<'de> for FoldRegionId
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FoldRegionId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FoldRegionId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Hash for FoldRegionId
impl Hash for FoldRegionId
§impl PartialEq for FoldRegionId
impl PartialEq for FoldRegionId
§impl Serialize for FoldRegionId
impl Serialize for FoldRegionId
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for FoldRegionId
impl Eq for FoldRegionId
impl StructuralPartialEq for FoldRegionId
Auto Trait Implementations§
impl Freeze for FoldRegionId
impl RefUnwindSafe for FoldRegionId
impl Send for FoldRegionId
impl Sync for FoldRegionId
impl Unpin for FoldRegionId
impl UnwindSafe for FoldRegionId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.