pub struct LspContent(_);
Expand description

Represents the content for LSP data

Implementations§

source§

impl LspContent

source

pub fn convert_local_scheme_to_distant(&mut self)

Converts all URIs with file as the scheme to distant instead

source

pub fn convert_local_scheme_to(&mut self, scheme: &str)

Converts all URIs with file as the scheme to scheme instead

source

pub fn convert_distant_scheme_to_local(&mut self)

Converts all URIs with distant as the scheme to file instead

source

pub fn convert_scheme_to_local(&mut self, scheme: &str)

Converts all URIs with scheme as the scheme to file instead

Methods from Deref<Target = Map<String, Value>>§

source

pub fn clear(&mut self)

Clears the map, removing all values.

source

pub fn get<Q>(&self, key: &Q) -> Option<&Value>where String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn contains_key<Q>(&self, key: &Q) -> boolwhere String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Returns true if the map contains a value for the specified key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value>where String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Returns a mutable reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&String, &Value)>where String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Returns the key-value pair matching the given key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn insert(&mut self, k: String, v: Value) -> Option<Value>

Inserts a key-value pair into the map.

If the map did not have this key present, None is returned.

If the map did have this key present, the value is updated, and the old value is returned.

source

pub fn remove<Q>(&mut self, key: &Q) -> Option<Value>where String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Removes a key from the map, returning the value at the key if the key was previously in the map.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(String, Value)>where String: Borrow<Q>, Q: Ord + Eq + Hash + ?Sized,

Removes a key from the map, returning the stored key and value if the key was previously in the map.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn append(&mut self, other: &mut Map<String, Value>)

Moves all elements from other into self, leaving other empty.

source

pub fn entry<S>(&mut self, key: S) -> Entry<'_>where S: Into<String>,

Gets the given key’s corresponding entry in the map for in-place manipulation.

source

pub fn len(&self) -> usize

Returns the number of elements in the map.

source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

source

pub fn iter(&self) -> Iter<'_>

Gets an iterator over the entries of the map.

source

pub fn iter_mut(&mut self) -> IterMut<'_>

Gets a mutable iterator over the entries of the map.

source

pub fn keys(&self) -> Keys<'_>

Gets an iterator over the keys of the map.

source

pub fn values(&self) -> Values<'_>

Gets an iterator over the values of the map.

source

pub fn values_mut(&mut self) -> ValuesMut<'_>

Gets an iterator over mutable values of the map.

source

pub fn retain<F>(&mut self, f: F)where F: FnMut(&String, &mut Value) -> bool,

Retains only the elements specified by the predicate.

In other words, remove all pairs (k, v) such that f(&k, &mut v) returns false.

Trait Implementations§

source§

impl AsRef<Map<String, Value>> for LspContent

source§

fn as_ref(&self) -> &Map<String, Value>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for LspContent

source§

fn clone(&self) -> LspContent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LspContent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for LspContent

§

type Target = Map<String, Value>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for LspContent

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for LspContent

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for LspContent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Outputs content in JSON form

source§

impl FromStr for LspContent

source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses content in JSON form

§

type Err = LspContentParseError

The associated error which can be returned from parsing.
source§

impl PartialEq<LspContent> for LspContent

source§

fn eq(&self, other: &LspContent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for LspContent

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for LspContent

source§

impl StructuralEq for LspContent

source§

impl StructuralPartialEq for LspContent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for Twhere T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts reference to Any
source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Converts mutable reference to Any
source§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Consumes and produces Box<dyn Any>
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,