Struct lsp2::PositionEncodingKind
pub struct PositionEncodingKind(_);
Expand description
A type indicating how positions are encoded, specifically what column offsets mean.
@since 3.17.0
Implementations§
§impl PositionEncodingKind
impl PositionEncodingKind
pub const UTF8: PositionEncodingKind = PositionEncodingKind::new("utf-8")
pub const UTF8: PositionEncodingKind = PositionEncodingKind::new("utf-8")
Character offsets count UTF-8 code units.
pub const UTF16: PositionEncodingKind = PositionEncodingKind::new("utf-16")
pub const UTF16: PositionEncodingKind = PositionEncodingKind::new("utf-16")
Character offsets count UTF-16 code units.
This is the default and must always be supported by servers
pub const UTF32: PositionEncodingKind = PositionEncodingKind::new("utf-32")
pub const UTF32: PositionEncodingKind = PositionEncodingKind::new("utf-32")
Character offsets count UTF-32 code units.
Implementation note: these are the same as Unicode code points,
so this PositionEncodingKind
may also be used for an
encoding-agnostic representation of character offsets.
pub const fn new(tag: &'static str) -> PositionEncodingKind
pub fn as_str(&self) -> &str
Trait Implementations§
§impl Clone for PositionEncodingKind
impl Clone for PositionEncodingKind
§fn clone(&self) -> PositionEncodingKind
fn clone(&self) -> PositionEncodingKind
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 PositionEncodingKind
impl Debug for PositionEncodingKind
§impl<'de> Deserialize<'de> for PositionEncodingKind
impl<'de> Deserialize<'de> for PositionEncodingKind
§fn deserialize<__D>(
__deserializer: __D
) -> Result<PositionEncodingKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<PositionEncodingKind, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<&'static str> for PositionEncodingKind
impl From<&'static str> for PositionEncodingKind
§fn from(from: &'static str) -> PositionEncodingKind
fn from(from: &'static str) -> PositionEncodingKind
Converts to this type from the input type.
§impl From<String> for PositionEncodingKind
impl From<String> for PositionEncodingKind
§fn from(from: String) -> PositionEncodingKind
fn from(from: String) -> PositionEncodingKind
Converts to this type from the input type.
§impl Hash for PositionEncodingKind
impl Hash for PositionEncodingKind
§impl PartialEq<PositionEncodingKind> for PositionEncodingKind
impl PartialEq<PositionEncodingKind> for PositionEncodingKind
§fn eq(&self, other: &PositionEncodingKind) -> bool
fn eq(&self, other: &PositionEncodingKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd<PositionEncodingKind> for PositionEncodingKind
impl PartialOrd<PositionEncodingKind> for PositionEncodingKind
§fn partial_cmp(&self, other: &PositionEncodingKind) -> Option<Ordering>
fn partial_cmp(&self, other: &PositionEncodingKind) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for PositionEncodingKind
impl Serialize for PositionEncodingKind
§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 Eq for PositionEncodingKind
impl StructuralEq for PositionEncodingKind
impl StructuralPartialEq for PositionEncodingKind
Auto Trait Implementations§
impl RefUnwindSafe for PositionEncodingKind
impl Send for PositionEncodingKind
impl Sync for PositionEncodingKind
impl Unpin for PositionEncodingKind
impl UnwindSafe for PositionEncodingKind
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.