pub struct EditorRange {
pub from: u32,
pub to: u32,
}Expand description
Half-open byte-offset range [from, to) into the original markdown
source. Bytes, not characters: positions are taken straight from
&str slicing math so they line up with what the editor receives over
the wire (the markdown is shipped as a String, and CodeMirror’s own
position model is on the JS side; we never index the source as chars).
u32 instead of usize so specta maps the fields to TS number
rather than string (JS Number can represent the full u32 range
precisely; a 64-bit usize cannot fit losslessly). 4 GiB markdown
is not a real moss editor scenario.
Fields§
§from: u32§to: u32Trait Implementations§
Source§impl Clone for EditorRange
impl Clone for EditorRange
Source§fn clone(&self) -> EditorRange
fn clone(&self) -> EditorRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EditorRange
Source§impl Debug for EditorRange
impl Debug for EditorRange
Source§impl<'de> Deserialize<'de> for EditorRange
impl<'de> Deserialize<'de> for EditorRange
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 Eq for EditorRange
Source§impl PartialEq for EditorRange
impl PartialEq for EditorRange
Source§impl Serialize for EditorRange
impl Serialize for EditorRange
impl StructuralPartialEq for EditorRange
Auto Trait Implementations§
impl Freeze for EditorRange
impl RefUnwindSafe for EditorRange
impl Send for EditorRange
impl Sync for EditorRange
impl Unpin for EditorRange
impl UnsafeUnpin for EditorRange
impl UnwindSafe for EditorRange
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.