pub struct Rc<T, A = Global>{ /* private fields */ }Expand description
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
See the module-level documentation for more details.
The inherent methods of Rc are all associated functions, which means
that you have to call them as e.g., Rc::get_mut(&mut value) instead of
value.get_mut(). This avoids conflicts with methods of the inner type T.
Implementations§
Source§impl<T> Rc<T>
impl<T> Rc<T>
1.60.0 · Sourcepub fn new_cyclic<F>(data_fn: F) -> Rc<T>
pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
Constructs a new Rc<T> while giving you a Weak<T> to the allocation,
to allow you to construct a T which holds a weak pointer to itself.
Generally, a structure circularly referencing itself, either directly or
indirectly, should not hold a strong reference to itself to prevent a memory leak.
Using this function, you get access to the weak pointer during the
initialization of T, before the Rc<T> is created, such that you can
clone and store it inside the T.
new_cyclic first allocates the managed allocation for the Rc<T>,
then calls your closure, giving it a Weak<T> to this allocation,
and only afterwards completes the construction of the Rc<T> by placing
the T returned from your closure into the allocation.
Since the new Rc<T> is not fully-constructed until Rc<T>::new_cyclic
returns, calling upgrade on the weak reference inside your closure will
fail and result in a None value.
§Panics
If data_fn panics, the panic is propagated to the caller, and the
temporary Weak<T> is dropped normally.
§Examples
use std::rc::{Rc, Weak};
struct Gadget {
me: Weak<Gadget>,
}
impl Gadget {
/// Constructs a reference counted Gadget.
fn new() -> Rc<Self> {
// `me` is a `Weak<Gadget>` pointing at the new allocation of the
// `Rc` we're constructing.
Rc::new_cyclic(|me| {
// Create the actual struct here.
Gadget { me: me.clone() }
})
}
/// Returns a reference counted pointer to Self.
fn me(&self) -> Rc<Self> {
self.me.upgrade().unwrap()
}
}1.82.0 · Sourcepub fn new_uninit() -> Rc<MaybeUninit<T>>
pub fn new_uninit() -> Rc<MaybeUninit<T>>
Constructs a new Rc with uninitialized contents.
§Examples
use std::rc::Rc;
let mut five = Rc::<u32>::new_uninit();
// Deferred initialization:
Rc::get_mut(&mut five).unwrap().write(5);
let five = unsafe { five.assume_init() };
assert_eq!(*five, 5)1.92.0 · Sourcepub fn new_zeroed() -> Rc<MaybeUninit<T>>
pub fn new_zeroed() -> Rc<MaybeUninit<T>>
Constructs a new Rc with uninitialized contents, with the memory
being filled with 0 bytes.
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
use std::rc::Rc;
let zero = Rc::<u32>::new_zeroed();
let zero = unsafe { zero.assume_init() };
assert_eq!(*zero, 0)Sourcepub fn try_new(value: T) -> Result<Rc<T>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new(value: T) -> Result<Rc<T>, AllocError>
allocator_api)Constructs a new Rc<T>, returning an error if the allocation fails
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
let five = Rc::try_new(5);Sourcepub fn try_new_uninit() -> Result<Rc<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new_uninit() -> Result<Rc<MaybeUninit<T>>, AllocError>
allocator_api)Constructs a new Rc with uninitialized contents, returning an error if the allocation fails
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
let mut five = Rc::<u32>::try_new_uninit()?;
// Deferred initialization:
Rc::get_mut(&mut five).unwrap().write(5);
let five = unsafe { five.assume_init() };
assert_eq!(*five, 5);Sourcepub fn try_new_zeroed() -> Result<Rc<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new_zeroed() -> Result<Rc<MaybeUninit<T>>, AllocError>
allocator_api)Constructs a new Rc with uninitialized contents, with the memory
being filled with 0 bytes, returning an error if the allocation fails
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
let zero = Rc::<u32>::try_new_zeroed()?;
let zero = unsafe { zero.assume_init() };
assert_eq!(*zero, 0);1.33.0 · Sourcepub fn pin(value: T) -> Pin<Rc<T>>
pub fn pin(value: T) -> Pin<Rc<T>>
Constructs a new Pin<Rc<T>>. If T does not implement Unpin, then
value will be pinned in memory and unable to be moved.
Sourcepub fn map<U>(this: Rc<T>, f: impl FnOnce(&T) -> U) -> Rc<U>
🔬This is a nightly-only experimental API. (smart_pointer_try_map)
pub fn map<U>(this: Rc<T>, f: impl FnOnce(&T) -> U) -> Rc<U>
smart_pointer_try_map)Maps the value in an Rc, reusing the allocation if possible.
f is called on a reference to the value in the Rc, and the result is returned, also in
an Rc.
Note: this is an associated function, which means that you have
to call it as Rc::map(r, f) instead of r.map(f). This
is so that there is no conflict with a method on the inner type.
§Examples
#![feature(smart_pointer_try_map)]
use std::rc::Rc;
let r = Rc::new(7);
let new = Rc::map(r, |i| i + 7);
assert_eq!(*new, 14);Sourcepub fn try_map<R>(
this: Rc<T>,
f: impl FnOnce(&T) -> R,
) -> <<R as Try>::Residual as Residual<Rc<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (smart_pointer_try_map)
pub fn try_map<R>( this: Rc<T>, f: impl FnOnce(&T) -> R, ) -> <<R as Try>::Residual as Residual<Rc<<R as Try>::Output>>>::TryType
smart_pointer_try_map)Attempts to map the value in an Rc, reusing the allocation if possible.
f is called on a reference to the value in the Rc, and if the operation succeeds, the
result is returned, also in an Rc.
Note: this is an associated function, which means that you have
to call it as Rc::try_map(r, f) instead of r.try_map(f). This
is so that there is no conflict with a method on the inner type.
§Examples
#![feature(smart_pointer_try_map)]
use std::rc::Rc;
let b = Rc::new(7);
let new = Rc::try_map(b, |&i| u32::try_from(i)).unwrap();
assert_eq!(*new, 7);Source§impl<T, A> Rc<T, A>where
A: Allocator,
impl<T, A> Rc<T, A>where
A: Allocator,
Sourcepub fn new_in(value: T, alloc: A) -> Rc<T, A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_in(value: T, alloc: A) -> Rc<T, A>
allocator_api)Constructs a new Rc in the provided allocator.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let five = Rc::new_in(5, System);Sourcepub fn new_uninit_in(alloc: A) -> Rc<MaybeUninit<T>, A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_uninit_in(alloc: A) -> Rc<MaybeUninit<T>, A>
allocator_api)Constructs a new Rc with uninitialized contents in the provided allocator.
§Examples
#![feature(get_mut_unchecked)]
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let mut five = Rc::<u32, _>::new_uninit_in(System);
let five = unsafe {
// Deferred initialization:
Rc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);
five.assume_init()
};
assert_eq!(*five, 5)Sourcepub fn new_zeroed_in(alloc: A) -> Rc<MaybeUninit<T>, A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_zeroed_in(alloc: A) -> Rc<MaybeUninit<T>, A>
allocator_api)Constructs a new Rc with uninitialized contents, with the memory
being filled with 0 bytes, in the provided allocator.
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let zero = Rc::<u32, _>::new_zeroed_in(System);
let zero = unsafe { zero.assume_init() };
assert_eq!(*zero, 0)Sourcepub fn new_cyclic_in<F>(data_fn: F, alloc: A) -> Rc<T, A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_cyclic_in<F>(data_fn: F, alloc: A) -> Rc<T, A>
allocator_api)Constructs a new Rc<T, A> in the given allocator while giving you a Weak<T, A> to the allocation,
to allow you to construct a T which holds a weak pointer to itself.
Generally, a structure circularly referencing itself, either directly or
indirectly, should not hold a strong reference to itself to prevent a memory leak.
Using this function, you get access to the weak pointer during the
initialization of T, before the Rc<T, A> is created, such that you can
clone and store it inside the T.
new_cyclic_in first allocates the managed allocation for the Rc<T, A>,
then calls your closure, giving it a Weak<T, A> to this allocation,
and only afterwards completes the construction of the Rc<T, A> by placing
the T returned from your closure into the allocation.
Since the new Rc<T, A> is not fully-constructed until Rc<T, A>::new_cyclic_in
returns, calling upgrade on the weak reference inside your closure will
fail and result in a None value.
§Panics
If data_fn panics, the panic is propagated to the caller, and the
temporary Weak<T, A> is dropped normally.
§Examples
See new_cyclic.
Sourcepub fn try_new_in(value: T, alloc: A) -> Result<Rc<T, A>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new_in(value: T, alloc: A) -> Result<Rc<T, A>, AllocError>
allocator_api)Constructs a new Rc<T> in the provided allocator, returning an error if the allocation
fails
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let five = Rc::try_new_in(5, System);Sourcepub fn try_new_uninit_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new_uninit_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>
allocator_api)Constructs a new Rc with uninitialized contents, in the provided allocator, returning an
error if the allocation fails
§Examples
#![feature(allocator_api)]
#![feature(get_mut_unchecked)]
use std::rc::Rc;
use std::alloc::System;
let mut five = Rc::<u32, _>::try_new_uninit_in(System)?;
let five = unsafe {
// Deferred initialization:
Rc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);
five.assume_init()
};
assert_eq!(*five, 5);Sourcepub fn try_new_zeroed_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn try_new_zeroed_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>
allocator_api)Constructs a new Rc with uninitialized contents, with the memory
being filled with 0 bytes, in the provided allocator, returning an error if the allocation
fails
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let zero = Rc::<u32, _>::try_new_zeroed_in(System)?;
let zero = unsafe { zero.assume_init() };
assert_eq!(*zero, 0);Sourcepub fn pin_in(value: T, alloc: A) -> Pin<Rc<T, A>>where
A: 'static,
🔬This is a nightly-only experimental API. (allocator_api)
pub fn pin_in(value: T, alloc: A) -> Pin<Rc<T, A>>where
A: 'static,
allocator_api)Constructs a new Pin<Rc<T>> in the provided allocator. If T does not implement Unpin, then
value will be pinned in memory and unable to be moved.
1.4.0 · Sourcepub fn try_unwrap(this: Rc<T, A>) -> Result<T, Rc<T, A>>
pub fn try_unwrap(this: Rc<T, A>) -> Result<T, Rc<T, A>>
Returns the inner value, if the Rc has exactly one strong reference.
Otherwise, an Err is returned with the same Rc that was
passed in.
This will succeed even if there are outstanding weak references.
§Examples
use std::rc::Rc;
let x = Rc::new(3);
assert_eq!(Rc::try_unwrap(x), Ok(3));
let x = Rc::new(4);
let _y = Rc::clone(&x);
assert_eq!(*Rc::try_unwrap(x).unwrap_err(), 4);1.70.0 · Sourcepub fn into_inner(this: Rc<T, A>) -> Option<T>
pub fn into_inner(this: Rc<T, A>) -> Option<T>
Returns the inner value, if the Rc has exactly one strong reference.
Otherwise, None is returned and the Rc is dropped.
This will succeed even if there are outstanding weak references.
If Rc::into_inner is called on every clone of this Rc,
it is guaranteed that exactly one of the calls returns the inner value.
This means in particular that the inner value is not dropped.
Rc::try_unwrap is conceptually similar to Rc::into_inner.
And while they are meant for different use-cases, Rc::into_inner(this)
is in fact equivalent to Rc::try_unwrap(this).ok().
(Note that the same kind of equivalence does not hold true for
Arc, due to race conditions that do not apply to Rc!)
§Examples
use std::rc::Rc;
let x = Rc::new(3);
assert_eq!(Rc::into_inner(x), Some(3));
let x = Rc::new(4);
let y = Rc::clone(&x);
assert_eq!(Rc::into_inner(y), None);
assert_eq!(Rc::into_inner(x), Some(4));Source§impl<T> Rc<[T]>
impl<T> Rc<[T]>
1.82.0 · Sourcepub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]>
pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]>
Constructs a new reference-counted slice with uninitialized contents.
§Examples
use std::rc::Rc;
let mut values = Rc::<[u32]>::new_uninit_slice(3);
// Deferred initialization:
let data = Rc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);
let values = unsafe { values.assume_init() };
assert_eq!(*values, [1, 2, 3])1.92.0 · Sourcepub fn new_zeroed_slice(len: usize) -> Rc<[MaybeUninit<T>]>
pub fn new_zeroed_slice(len: usize) -> Rc<[MaybeUninit<T>]>
Constructs a new reference-counted slice with uninitialized contents, with the memory being
filled with 0 bytes.
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
use std::rc::Rc;
let values = Rc::<[u32]>::new_zeroed_slice(3);
let values = unsafe { values.assume_init() };
assert_eq!(*values, [0, 0, 0])Sourcepub fn into_array<const N: usize>(self) -> Option<Rc<[T; N]>>
🔬This is a nightly-only experimental API. (alloc_slice_into_array)
pub fn into_array<const N: usize>(self) -> Option<Rc<[T; N]>>
alloc_slice_into_array)Converts the reference-counted slice into a reference-counted array.
This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type.
If N is not exactly equal to the length of self, then this method returns None.
Source§impl<T, A> Rc<[T], A>where
A: Allocator,
impl<T, A> Rc<[T], A>where
A: Allocator,
Sourcepub fn new_uninit_slice_in(len: usize, alloc: A) -> Rc<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_uninit_slice_in(len: usize, alloc: A) -> Rc<[MaybeUninit<T>], A>
allocator_api)Constructs a new reference-counted slice with uninitialized contents.
§Examples
#![feature(get_mut_unchecked)]
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let mut values = Rc::<[u32], _>::new_uninit_slice_in(3, System);
let values = unsafe {
// Deferred initialization:
Rc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
Rc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
Rc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
values.assume_init()
};
assert_eq!(*values, [1, 2, 3])Sourcepub fn new_zeroed_slice_in(len: usize, alloc: A) -> Rc<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api)
pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Rc<[MaybeUninit<T>], A>
allocator_api)Constructs a new reference-counted slice with uninitialized contents, with the memory being
filled with 0 bytes.
See MaybeUninit::zeroed for examples of correct and
incorrect usage of this method.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let values = Rc::<[u32], _>::new_zeroed_slice_in(3, System);
let values = unsafe { values.assume_init() };
assert_eq!(*values, [0, 0, 0])Source§impl<T, A> Rc<MaybeUninit<T>, A>where
A: Allocator,
impl<T, A> Rc<MaybeUninit<T>, A>where
A: Allocator,
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Rc<T, A>
pub unsafe fn assume_init(self) -> Rc<T, A>
Converts to Rc<T>.
§Safety
As with MaybeUninit::assume_init,
it is up to the caller to guarantee that the inner value
really is in an initialized state.
Calling this when the content is not yet fully initialized
causes immediate undefined behavior.
§Examples
use std::rc::Rc;
let mut five = Rc::<u32>::new_uninit();
// Deferred initialization:
Rc::get_mut(&mut five).unwrap().write(5);
let five = unsafe { five.assume_init() };
assert_eq!(*five, 5)Source§impl<T> Rc<T>where
T: CloneToUninit + ?Sized,
impl<T> Rc<T>where
T: CloneToUninit + ?Sized,
Sourcepub fn clone_from_ref(value: &T) -> Rc<T>
🔬This is a nightly-only experimental API. (clone_from_ref)
pub fn clone_from_ref(value: &T) -> Rc<T>
clone_from_ref)Constructs a new Rc<T> with a clone of value.
§Examples
#![feature(clone_from_ref)]
use std::rc::Rc;
let hello: Rc<str> = Rc::clone_from_ref("hello");Sourcepub fn try_clone_from_ref(value: &T) -> Result<Rc<T>, AllocError>
🔬This is a nightly-only experimental API. (clone_from_ref)
pub fn try_clone_from_ref(value: &T) -> Result<Rc<T>, AllocError>
clone_from_ref)Constructs a new Rc<T> with a clone of value, returning an error if allocation fails
§Examples
#![feature(clone_from_ref)]
#![feature(allocator_api)]
use std::rc::Rc;
let hello: Rc<str> = Rc::try_clone_from_ref("hello")?;Source§impl<T, A> Rc<T, A>
impl<T, A> Rc<T, A>
Sourcepub fn clone_from_ref_in(value: &T, alloc: A) -> Rc<T, A>
🔬This is a nightly-only experimental API. (clone_from_ref)
pub fn clone_from_ref_in(value: &T, alloc: A) -> Rc<T, A>
clone_from_ref)Constructs a new Rc<T> with a clone of value in the provided allocator.
§Examples
#![feature(clone_from_ref)]
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let hello: Rc<str, System> = Rc::clone_from_ref_in("hello", System);Sourcepub fn try_clone_from_ref_in(
value: &T,
alloc: A,
) -> Result<Rc<T, A>, AllocError>
🔬This is a nightly-only experimental API. (clone_from_ref)
pub fn try_clone_from_ref_in( value: &T, alloc: A, ) -> Result<Rc<T, A>, AllocError>
clone_from_ref)Constructs a new Rc<T> with a clone of value in the provided allocator, returning an error if allocation fails
§Examples
#![feature(clone_from_ref)]
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let hello: Rc<str, System> = Rc::try_clone_from_ref_in("hello", System)?;Source§impl<T, A> Rc<[MaybeUninit<T>], A>where
A: Allocator,
impl<T, A> Rc<[MaybeUninit<T>], A>where
A: Allocator,
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Rc<[T], A>
pub unsafe fn assume_init(self) -> Rc<[T], A>
Converts to Rc<[T]>.
§Safety
As with MaybeUninit::assume_init,
it is up to the caller to guarantee that the inner value
really is in an initialized state.
Calling this when the content is not yet fully initialized
causes immediate undefined behavior.
§Examples
use std::rc::Rc;
let mut values = Rc::<[u32]>::new_uninit_slice(3);
// Deferred initialization:
let data = Rc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);
let values = unsafe { values.assume_init() };
assert_eq!(*values, [1, 2, 3])Source§impl<T> Rc<T>where
T: ?Sized,
impl<T> Rc<T>where
T: ?Sized,
1.17.0 · Sourcepub unsafe fn from_raw(ptr: *const T) -> Rc<T>
pub unsafe fn from_raw(ptr: *const T) -> Rc<T>
Constructs an Rc<T> from a raw pointer.
The raw pointer must have been previously returned by a call to
Rc<U>::into_raw with the following requirements:
- If
Uis sized, it must have the same size and alignment asT. This is trivially true ifUisT. - If
Uis unsized, its data pointer must have the same size and alignment asT. This is trivially true ifRc<U>was constructed throughRc<T>and then converted toRc<U>through an unsized coercion.
Note that if U or U’s data pointer is not T but has the same size
and alignment, this is basically like transmuting references of
different types. See mem::transmute for more information
on what restrictions apply in this case.
The raw pointer must point to a block of memory allocated by the global allocator
The user of from_raw has to make sure a specific value of T is only
dropped once.
This function is unsafe because improper use may lead to memory unsafety,
even if the returned Rc<T> is never accessed.
§Examples
use std::rc::Rc;
let x = Rc::new("hello".to_owned());
let x_ptr = Rc::into_raw(x);
unsafe {
// Convert back to an `Rc` to prevent leak.
let x = Rc::from_raw(x_ptr);
assert_eq!(&*x, "hello");
// Further calls to `Rc::from_raw(x_ptr)` would be memory-unsafe.
}
// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!Convert a slice back into its original array:
use std::rc::Rc;
let x: Rc<[u32]> = Rc::new([1, 2, 3]);
let x_ptr: *const [u32] = Rc::into_raw(x);
unsafe {
let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>());
assert_eq!(&*x, &[1, 2, 3]);
}1.17.0 · Sourcepub fn into_raw(this: Rc<T>) -> *const T
pub fn into_raw(this: Rc<T>) -> *const T
Consumes the Rc, returning the wrapped pointer.
To avoid a memory leak the pointer must be converted back to an Rc using
Rc::from_raw.
§Examples
use std::rc::Rc;
let x = Rc::new("hello".to_owned());
let x_ptr = Rc::into_raw(x);
assert_eq!(unsafe { &*x_ptr }, "hello");1.53.0 · Sourcepub unsafe fn increment_strong_count(ptr: *const T)
pub unsafe fn increment_strong_count(ptr: *const T)
Increments the strong reference count on the Rc<T> associated with the
provided pointer by one.
§Safety
The pointer must have been obtained through Rc::into_raw and must satisfy the
same layout requirements specified in Rc::from_raw_in.
The associated Rc instance must be valid (i.e. the strong count must be at
least 1) for the duration of this method, and ptr must point to a block of memory
allocated by the global allocator.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
unsafe {
let ptr = Rc::into_raw(five);
Rc::increment_strong_count(ptr);
let five = Rc::from_raw(ptr);
assert_eq!(2, Rc::strong_count(&five));
}1.53.0 · Sourcepub unsafe fn decrement_strong_count(ptr: *const T)
pub unsafe fn decrement_strong_count(ptr: *const T)
Decrements the strong reference count on the Rc<T> associated with the
provided pointer by one.
§Safety
The pointer must have been obtained through Rc::into_rawand must satisfy the
same layout requirements specified in Rc::from_raw_in.
The associated Rc instance must be valid (i.e. the strong count must be at
least 1) when invoking this method, and ptr must point to a block of memory
allocated by the global allocator. This method can be used to release the final Rc and
backing storage, but should not be called after the final Rc has been released.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
unsafe {
let ptr = Rc::into_raw(five);
Rc::increment_strong_count(ptr);
let five = Rc::from_raw(ptr);
assert_eq!(2, Rc::strong_count(&five));
Rc::decrement_strong_count(ptr);
assert_eq!(1, Rc::strong_count(&five));
}Source§impl<T, A> Rc<T, A>
impl<T, A> Rc<T, A>
Sourcepub fn allocator(this: &Rc<T, A>) -> &A
🔬This is a nightly-only experimental API. (allocator_api)
pub fn allocator(this: &Rc<T, A>) -> &A
allocator_api)Returns a reference to the underlying allocator.
Note: this is an associated function, which means that you have
to call it as Rc::allocator(&r) instead of r.allocator(). This
is so that there is no conflict with a method on the inner type.
Sourcepub fn into_raw_with_allocator(this: Rc<T, A>) -> (*const T, A)
🔬This is a nightly-only experimental API. (allocator_api)
pub fn into_raw_with_allocator(this: Rc<T, A>) -> (*const T, A)
allocator_api)Consumes the Rc, returning the wrapped pointer and allocator.
To avoid a memory leak the pointer must be converted back to an Rc using
Rc::from_raw_in.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let x = Rc::new_in("hello".to_owned(), System);
let (ptr, alloc) = Rc::into_raw_with_allocator(x);
assert_eq!(unsafe { &*ptr }, "hello");
let x = unsafe { Rc::from_raw_in(ptr, alloc) };
assert_eq!(&*x, "hello");1.45.0 · Sourcepub fn as_ptr(this: &Rc<T, A>) -> *const T
pub fn as_ptr(this: &Rc<T, A>) -> *const T
Provides a raw pointer to the data.
The counts are not affected in any way and the Rc is not consumed. The pointer is valid
for as long as there are strong counts in the Rc.
§Examples
use std::rc::Rc;
let x = Rc::new(0);
let y = Rc::clone(&x);
let x_ptr = Rc::as_ptr(&x);
assert_eq!(x_ptr, Rc::as_ptr(&y));
assert_eq!(unsafe { *x_ptr }, 0);Sourcepub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Rc<T, A>
🔬This is a nightly-only experimental API. (allocator_api)
pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Rc<T, A>
allocator_api)Constructs an Rc<T, A> from a raw pointer in the provided allocator.
The raw pointer must have been previously returned by a call to Rc<U, A>::into_raw with the following requirements:
- If
Uis sized, it must have the same size and alignment asT. This is trivially true ifUisT. - If
Uis unsized, its data pointer must have the same size and alignment asT. This is trivially true ifRc<U>was constructed throughRc<T>and then converted toRc<U>through an unsized coercion.
Note that if U or U’s data pointer is not T but has the same size
and alignment, this is basically like transmuting references of
different types. See mem::transmute for more information
on what restrictions apply in this case.
The raw pointer must point to a block of memory allocated by alloc
The user of from_raw has to make sure a specific value of T is only
dropped once.
This function is unsafe because improper use may lead to memory unsafety,
even if the returned Rc<T> is never accessed.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let x = Rc::new_in("hello".to_owned(), System);
let (x_ptr, _alloc) = Rc::into_raw_with_allocator(x);
unsafe {
// Convert back to an `Rc` to prevent leak.
let x = Rc::from_raw_in(x_ptr, System);
assert_eq!(&*x, "hello");
// Further calls to `Rc::from_raw(x_ptr)` would be memory-unsafe.
}
// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!Convert a slice back into its original array:
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System);
let x_ptr: *const [u32] = Rc::into_raw_with_allocator(x).0;
unsafe {
let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
assert_eq!(&*x, &[1, 2, 3]);
}1.15.0 · Sourcepub fn weak_count(this: &Rc<T, A>) -> usize
pub fn weak_count(this: &Rc<T, A>) -> usize
1.15.0 · Sourcepub fn strong_count(this: &Rc<T, A>) -> usize
pub fn strong_count(this: &Rc<T, A>) -> usize
Gets the number of strong (Rc) pointers to this allocation.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
let _also_five = Rc::clone(&five);
assert_eq!(2, Rc::strong_count(&five));Sourcepub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)where
A: Clone,
🔬This is a nightly-only experimental API. (allocator_api)
pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)where
A: Clone,
allocator_api)Increments the strong reference count on the Rc<T> associated with the
provided pointer by one.
§Safety
The pointer must have been obtained through Rc::into_raw and must satisfy the
same layout requirements specified in Rc::from_raw_in.
The associated Rc instance must be valid (i.e. the strong count must be at
least 1) for the duration of this method, and ptr must point to a block of memory
allocated by alloc.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let five = Rc::new_in(5, System);
unsafe {
let (ptr, _alloc) = Rc::into_raw_with_allocator(five);
Rc::increment_strong_count_in(ptr, System);
let five = Rc::from_raw_in(ptr, System);
assert_eq!(2, Rc::strong_count(&five));
}Sourcepub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)
🔬This is a nightly-only experimental API. (allocator_api)
pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)
allocator_api)Decrements the strong reference count on the Rc<T> associated with the
provided pointer by one.
§Safety
The pointer must have been obtained through Rc::into_rawand must satisfy the
same layout requirements specified in Rc::from_raw_in.
The associated Rc instance must be valid (i.e. the strong count must be at
least 1) when invoking this method, and ptr must point to a block of memory
allocated by alloc. This method can be used to release the final Rc and
backing storage, but should not be called after the final Rc has been released.
§Examples
#![feature(allocator_api)]
use std::rc::Rc;
use std::alloc::System;
let five = Rc::new_in(5, System);
unsafe {
let (ptr, _alloc) = Rc::into_raw_with_allocator(five);
Rc::increment_strong_count_in(ptr, System);
let five = Rc::from_raw_in(ptr, System);
assert_eq!(2, Rc::strong_count(&five));
Rc::decrement_strong_count_in(ptr, System);
assert_eq!(1, Rc::strong_count(&five));
}1.4.0 · Sourcepub fn get_mut(this: &mut Rc<T, A>) -> Option<&mut T>
pub fn get_mut(this: &mut Rc<T, A>) -> Option<&mut T>
Returns a mutable reference into the given Rc, if there are
no other Rc or Weak pointers to the same allocation.
Returns None otherwise, because it is not safe to
mutate a shared value.
See also make_mut, which will clone
the inner value when there are other Rc pointers.
§Examples
use std::rc::Rc;
let mut x = Rc::new(3);
*Rc::get_mut(&mut x).unwrap() = 4;
assert_eq!(*x, 4);
let _y = Rc::clone(&x);
assert!(Rc::get_mut(&mut x).is_none());Sourcepub unsafe fn get_mut_unchecked(this: &mut Rc<T, A>) -> &mut T
🔬This is a nightly-only experimental API. (get_mut_unchecked)
pub unsafe fn get_mut_unchecked(this: &mut Rc<T, A>) -> &mut T
get_mut_unchecked)Returns a mutable reference into the given Rc,
without any check.
See also get_mut, which is safe and does appropriate checks.
§Safety
If any other Rc or Weak pointers to the same allocation exist, then
they must not be dereferenced or have active borrows for the duration
of the returned borrow, and their inner type must be exactly the same as the
inner type of this Rc (including lifetimes). This is trivially the case if no
such pointers exist, for example immediately after Rc::new.
§Examples
#![feature(get_mut_unchecked)]
use std::rc::Rc;
let mut x = Rc::new(String::new());
unsafe {
Rc::get_mut_unchecked(&mut x).push_str("foo")
}
assert_eq!(*x, "foo");Other Rc pointers to the same allocation must be to the same type.
#![feature(get_mut_unchecked)]
use std::rc::Rc;
let x: Rc<str> = Rc::from("Hello, world!");
let mut y: Rc<[u8]> = x.clone().into();
unsafe {
// this is Undefined Behavior, because x's inner type is str, not [u8]
Rc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8
}
println!("{}", &*x); // Invalid UTF-8 in a strOther Rc pointers to the same allocation must be to the exact same type, including lifetimes.
#![feature(get_mut_unchecked)]
use std::rc::Rc;
let x: Rc<&str> = Rc::new("Hello, world!");
{
let s = String::from("Oh, no!");
let mut y: Rc<&str> = x.clone();
unsafe {
// this is Undefined Behavior, because x's inner type
// is &'long str, not &'short str
*Rc::get_mut_unchecked(&mut y) = &s;
}
}
println!("{}", &*x); // Use-after-free1.17.0 · Sourcepub fn ptr_eq(this: &Rc<T, A>, other: &Rc<T, A>) -> bool
pub fn ptr_eq(this: &Rc<T, A>, other: &Rc<T, A>) -> bool
Returns true if the two Rcs point to the same allocation in a vein similar to
ptr::eq. This function ignores the metadata of dyn Trait pointers.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
let same_five = Rc::clone(&five);
let other_five = Rc::new(5);
assert!(Rc::ptr_eq(&five, &same_five));
assert!(!Rc::ptr_eq(&five, &other_five));Source§impl<T, A> Rc<T, A>
impl<T, A> Rc<T, A>
1.4.0 · Sourcepub fn make_mut(this: &mut Rc<T, A>) -> &mut T
pub fn make_mut(this: &mut Rc<T, A>) -> &mut T
Makes a mutable reference into the given Rc.
If there are other Rc pointers to the same allocation, then make_mut will
clone the inner value to a new allocation to ensure unique ownership. This is also
referred to as clone-on-write.
However, if there are no other Rc pointers to this allocation, but some Weak
pointers, then the Weak pointers will be disassociated and the inner value will not
be cloned.
See also get_mut, which will fail rather than cloning the inner value
or disassociating Weak pointers.
§Examples
use std::rc::Rc;
let mut data = Rc::new(5);
*Rc::make_mut(&mut data) += 1; // Won't clone anything
let mut other_data = Rc::clone(&data); // Won't clone inner data
*Rc::make_mut(&mut data) += 1; // Clones inner data
*Rc::make_mut(&mut data) += 1; // Won't clone anything
*Rc::make_mut(&mut other_data) *= 2; // Won't clone anything
// Now `data` and `other_data` point to different allocations.
assert_eq!(*data, 8);
assert_eq!(*other_data, 12);Weak pointers will be disassociated:
use std::rc::Rc;
let mut data = Rc::new(75);
let weak = Rc::downgrade(&data);
assert!(75 == *data);
assert!(75 == *weak.upgrade().unwrap());
*Rc::make_mut(&mut data) += 1;
assert!(76 == *data);
assert!(weak.upgrade().is_none());Source§impl<T, A> Rc<T, A>
impl<T, A> Rc<T, A>
1.76.0 · Sourcepub fn unwrap_or_clone(this: Rc<T, A>) -> T
pub fn unwrap_or_clone(this: Rc<T, A>) -> T
If we have the only reference to T then unwrap it. Otherwise, clone T and return the
clone.
Assuming rc_t is of type Rc<T>, this function is functionally equivalent to
(*rc_t).clone(), but will avoid cloning the inner value where possible.
§Examples
let inner = String::from("test");
let ptr = inner.as_ptr();
let rc = Rc::new(inner);
let inner = Rc::unwrap_or_clone(rc);
// The inner value was not cloned
assert!(ptr::eq(ptr, inner.as_ptr()));
let rc = Rc::new(inner);
let rc2 = rc.clone();
let inner = Rc::unwrap_or_clone(rc);
// Because there were 2 references, we had to clone the inner value.
assert!(!ptr::eq(ptr, inner.as_ptr()));
// `rc2` is the last reference, so when we unwrap it we get back
// the original `String`.
let inner = Rc::unwrap_or_clone(rc2);
assert!(ptr::eq(ptr, inner.as_ptr()));Source§impl<A> Rc<dyn Any, A>where
A: Allocator,
impl<A> Rc<dyn Any, A>where
A: Allocator,
1.29.0 · Sourcepub fn downcast<T>(self) -> Result<Rc<T, A>, Rc<dyn Any, A>>where
T: Any,
pub fn downcast<T>(self) -> Result<Rc<T, A>, Rc<dyn Any, A>>where
T: Any,
Attempts to downcast the Rc<dyn Any> to a concrete type.
§Examples
use std::any::Any;
use std::rc::Rc;
fn print_if_string(value: Rc<dyn Any>) {
if let Ok(string) = value.downcast::<String>() {
println!("String ({}): {}", string.len(), string);
}
}
let my_string = "Hello World".to_string();
print_if_string(Rc::new(my_string));
print_if_string(Rc::new(0i8));Sourcepub unsafe fn downcast_unchecked<T>(self) -> Rc<T, A>where
T: Any,
🔬This is a nightly-only experimental API. (downcast_unchecked)
pub unsafe fn downcast_unchecked<T>(self) -> Rc<T, A>where
T: Any,
downcast_unchecked)Downcasts the Rc<dyn Any> to a concrete type.
For a safe alternative see downcast.
§Examples
#![feature(downcast_unchecked)]
use std::any::Any;
use std::rc::Rc;
let x: Rc<dyn Any> = Rc::new(1_usize);
unsafe {
assert_eq!(*x.downcast_unchecked::<usize>(), 1);
}§Safety
The contained value must be of type T. Calling this method
with the incorrect type is undefined behavior.
Trait Implementations§
Source§impl<T, A> Allocator for Rc<T, A>
impl<T, A> Allocator for Rc<T, A>
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api)Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api)allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
allocator_api)ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
allocator_api)Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
allocator_api)grow, but also ensures that the new contents are set to zero before being
returned. Read more1.69.0 · Source§impl<T> AsFd for Rc<T>
impl<T> AsFd for Rc<T>
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
1.0.0 · Source§impl<T, A> Clone for Rc<T, A>
impl<T, A> Clone for Rc<T, A>
Source§fn clone(&self) -> Rc<T, A>
fn clone(&self) -> Rc<T, A>
Makes a clone of the Rc pointer.
This creates another pointer to the same allocation, increasing the strong reference count.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
let _ = Rc::clone(&five);1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more1.0.0 · Source§impl<T> Default for Rc<T>where
T: Default,
Available on non-no_global_oom_handling only.
impl<T> Default for Rc<T>where
T: Default,
no_global_oom_handling only.Source§impl<'de, T, U> DeserializeAs<'de, Pin<Rc<T>>> for Pin<Rc<U>>where
U: DeserializeAs<'de, T>,
impl<'de, T, U> DeserializeAs<'de, Pin<Rc<T>>> for Pin<Rc<U>>where
U: DeserializeAs<'de, T>,
Source§fn deserialize_as<D>(
deserializer: D,
) -> Result<Pin<Rc<T>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<Pin<Rc<T>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<'de, T, U> DeserializeAs<'de, Rc<T>> for Rc<U>where
U: DeserializeAs<'de, T>,
Available on crate feature alloc only.
impl<'de, T, U> DeserializeAs<'de, Rc<T>> for Rc<U>where
U: DeserializeAs<'de, T>,
alloc only.Source§fn deserialize_as<D>(
deserializer: D,
) -> Result<Rc<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<Rc<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
1.0.0 · Source§impl<T, A> Drop for Rc<T, A>
impl<T, A> Drop for Rc<T, A>
Source§fn drop(&mut self)
fn drop(&mut self)
Drops the Rc.
This will decrement the strong reference count. If the strong reference
count reaches zero then the only other references (if any) are
Weak, so we drop the inner value.
§Examples
use std::rc::Rc;
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {
println!("dropped!");
}
}
let foo = Rc::new(Foo);
let foo2 = Rc::clone(&foo);
drop(foo); // Doesn't print anything
drop(foo2); // Prints "dropped!"1.21.0 · Source§impl<T> From<&[T]> for Rc<[T]>where
T: Clone,
Available on non-no_global_oom_handling only.
impl<T> From<&[T]> for Rc<[T]>where
T: Clone,
no_global_oom_handling only.1.84.0 · Source§impl<T> From<&mut [T]> for Rc<[T]>where
T: Clone,
Available on non-no_global_oom_handling only.
impl<T> From<&mut [T]> for Rc<[T]>where
T: Clone,
no_global_oom_handling only.1.74.0 · Source§impl<T, const N: usize> From<[T; N]> for Rc<[T]>
Available on non-no_global_oom_handling only.
impl<T, const N: usize> From<[T; N]> for Rc<[T]>
no_global_oom_handling only.1.21.0 · Source§impl<T, A> From<Box<T, A>> for Rc<T, A>
Available on non-no_global_oom_handling only.
impl<T, A> From<Box<T, A>> for Rc<T, A>
no_global_oom_handling only.Source§impl<W> From<Rc<W>> for LocalWakerwhere
W: LocalWake + 'static,
impl<W> From<Rc<W>> for LocalWakerwhere
W: LocalWake + 'static,
Source§fn from(waker: Rc<W>) -> LocalWaker
fn from(waker: Rc<W>) -> LocalWaker
Use a Wake-able type as a LocalWaker.
No heap allocations or atomic operations are used for this conversion.
1.21.0 · Source§impl<T, A> From<Vec<T, A>> for Rc<[T], A>where
A: Allocator,
Available on non-no_global_oom_handling only.
impl<T, A> From<Vec<T, A>> for Rc<[T], A>where
A: Allocator,
no_global_oom_handling only.1.37.0 · Source§impl<T> FromIterator<T> for Rc<[T]>
Available on non-no_global_oom_handling only.
impl<T> FromIterator<T> for Rc<[T]>
no_global_oom_handling only.Source§fn from_iter<I>(iter: I) -> Rc<[T]>where
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Rc<[T]>where
I: IntoIterator<Item = T>,
Takes each element in the Iterator and collects it into an Rc<[T]>.
§Performance characteristics
§The general case
In the general case, collecting into Rc<[T]> is done by first
collecting into a Vec<T>. That is, when writing the following:
let evens: Rc<[u8]> = (0..10).filter(|&x| x % 2 == 0).collect();this behaves as if we wrote:
let evens: Rc<[u8]> = (0..10).filter(|&x| x % 2 == 0)
.collect::<Vec<_>>() // The first set of allocations happens here.
.into(); // A second allocation for `Rc<[T]>` happens here.This will allocate as many times as needed for constructing the Vec<T>
and then it will allocate once for turning the Vec<T> into the Rc<[T]>.
§Iterators of known length
When your Iterator implements TrustedLen and is of an exact size,
a single allocation will be made for the Rc<[T]>. For example:
let evens: Rc<[u8]> = (0..10).collect(); // Just a single allocation happens here.Source§impl<T> JsonSchema for Rc<T>where
T: JsonSchema + ?Sized,
impl<T> JsonSchema for Rc<T>where
T: JsonSchema + ?Sized,
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§impl<T, TA> JsonSchemaAs<Rc<T>> for Rc<TA>where
TA: JsonSchemaAs<T>,
T: ?Sized,
impl<T, TA> JsonSchemaAs<Rc<T>> for Rc<TA>where
TA: JsonSchemaAs<T>,
T: ?Sized,
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref
keyword. Read moreSource§impl<T> LanguageServer for Rc<T>
impl<T> LanguageServer for Rc<T>
Source§fn initialize<'life0, 'async_trait>(
&'life0 self,
params: InitializeParams,
) -> Pin<Box<dyn Future<Output = Result<InitializeResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
params: InitializeParams,
) -> Pin<Box<dyn Future<Output = Result<InitializeResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
initialize request is the first request sent from the client to the server. Read moreSource§fn initialized<'life0, 'async_trait>(
&'life0 self,
params: InitializedParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn initialized<'life0, 'async_trait>(
&'life0 self,
params: InitializedParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
initialized notification is sent from the client to the server after the client
received the result of the initialize request but before the client sends anything else. Read moreSource§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
Source§fn did_open<'life0, 'async_trait>(
&'life0 self,
params: DidOpenTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_open<'life0, 'async_trait>(
&'life0 self,
params: DidOpenTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/didOpen notification is sent from the client to the server to signal
that a new text document has been opened by the client. Read moreSource§fn did_change<'life0, 'async_trait>(
&'life0 self,
params: DidChangeTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_change<'life0, 'async_trait>(
&'life0 self,
params: DidChangeTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/didChange notification is sent from the client to the server to signal
changes to a text document. Read moreSource§fn will_save<'life0, 'async_trait>(
&'life0 self,
params: WillSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn will_save<'life0, 'async_trait>(
&'life0 self,
params: WillSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/willSave notification is sent from the client to the server before the
document is actually saved.Source§fn will_save_wait_until<'life0, 'async_trait>(
&'life0 self,
params: WillSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn will_save_wait_until<'life0, 'async_trait>(
&'life0 self,
params: WillSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/willSaveWaitUntil request is sent from the client to the server before
the document is actually saved. Read moreSource§fn did_save<'life0, 'async_trait>(
&'life0 self,
params: DidSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_save<'life0, 'async_trait>(
&'life0 self,
params: DidSaveTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/didSave notification is sent from the client to the server when the
document was saved in the client.Source§fn did_close<'life0, 'async_trait>(
&'life0 self,
params: DidCloseTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_close<'life0, 'async_trait>(
&'life0 self,
params: DidCloseTextDocumentParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/didClose notification is sent from the client to the server when the
document got closed in the client. Read moreSource§fn goto_declaration<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn goto_declaration<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/declaration request asks the server for the declaration location of a
symbol at a given text document position. Read moreSource§fn goto_definition<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn goto_definition<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/definition request asks the server for the definition location of a
symbol at a given text document position. Read moreSource§fn goto_type_definition<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn goto_type_definition<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/typeDefinition request asks the server for the type definition location of
a symbol at a given text document position. Read moreSource§fn goto_implementation<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn goto_implementation<'life0, 'async_trait>(
&'life0 self,
params: GotoDefinitionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/implementation request is sent from the client to the server to resolve
the implementation location of a symbol at a given text document position. Read moreSource§fn references<'life0, 'async_trait>(
&'life0 self,
params: ReferenceParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Location>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn references<'life0, 'async_trait>(
&'life0 self,
params: ReferenceParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Location>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/references request is sent from the client to the server to resolve
project-wide references for the symbol denoted by the given text document position.Source§fn prepare_call_hierarchy<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyPrepareParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn prepare_call_hierarchy<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyPrepareParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/prepareCallHierarchy request is sent from the client to the server to
return a call hierarchy for the language element of given text document positions. Read moreSource§fn incoming_calls<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyIncomingCallsParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyIncomingCall>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn incoming_calls<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyIncomingCallsParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyIncomingCall>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
callHierarchy/incomingCalls request is sent from the client to the server to
resolve incoming calls for a given call hierarchy item. Read moreSource§fn outgoing_calls<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyOutgoingCallsParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyOutgoingCall>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn outgoing_calls<'life0, 'async_trait>(
&'life0 self,
params: CallHierarchyOutgoingCallsParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CallHierarchyOutgoingCall>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
callHierarchy/outgoingCalls request is sent from the client to the server to
resolve outgoing calls for a given call hierarchy item. Read moreSource§fn prepare_type_hierarchy<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchyPrepareParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn prepare_type_hierarchy<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchyPrepareParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/prepareTypeHierarchy request is sent from the client to the server to
return a type hierarchy for the language element of given text document positions. Read moreSource§fn supertypes<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchySupertypesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn supertypes<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchySupertypesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
typeHierarchy/supertypes] request is sent from the client to the server to resolve
the supertypes for a given type hierarchy item. Read moreSource§fn subtypes<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchySubtypesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn subtypes<'life0, 'async_trait>(
&'life0 self,
params: TypeHierarchySubtypesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
typeHierarchy/subtypes] request is sent from the client to the server to resolve
the subtypes for a given type hierarchy item. Read moreSource§fn document_highlight<'life0, 'async_trait>(
&'life0 self,
params: DocumentHighlightParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<DocumentHighlight>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn document_highlight<'life0, 'async_trait>(
&'life0 self,
params: DocumentHighlightParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<DocumentHighlight>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/documentHighlight request is sent from the client to the server to
resolve appropriate highlights for a given text document position. Read moreSource§fn document_link<'life0, 'async_trait>(
&'life0 self,
params: DocumentLinkParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<DocumentLink>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn document_link<'life0, 'async_trait>(
&'life0 self,
params: DocumentLinkParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<DocumentLink>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/documentLink request is sent from the client to the server to request
the location of links in a document. Read moreSource§fn document_link_resolve<'life0, 'async_trait>(
&'life0 self,
params: DocumentLink,
) -> Pin<Box<dyn Future<Output = Result<DocumentLink, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn document_link_resolve<'life0, 'async_trait>(
&'life0 self,
params: DocumentLink,
) -> Pin<Box<dyn Future<Output = Result<DocumentLink, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
documentLink/resolve request is sent from the client to the server to resolve the
target of a given document link. Read moreSource§fn hover<'life0, 'async_trait>(
&'life0 self,
params: HoverParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Hover>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn hover<'life0, 'async_trait>(
&'life0 self,
params: HoverParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Hover>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/hover request asks the server for hover information at a given text
document position. Read moreSource§fn code_lens<'life0, 'async_trait>(
&'life0 self,
params: CodeLensParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CodeLens>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn code_lens<'life0, 'async_trait>(
&'life0 self,
params: CodeLensParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CodeLens>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/codeLens request is sent from the client to the server to compute code
lenses for a given text document.Source§fn code_lens_resolve<'life0, 'async_trait>(
&'life0 self,
params: CodeLens,
) -> Pin<Box<dyn Future<Output = Result<CodeLens, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn code_lens_resolve<'life0, 'async_trait>(
&'life0 self,
params: CodeLens,
) -> Pin<Box<dyn Future<Output = Result<CodeLens, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
codeLens/resolve request is sent from the client to the server to resolve the
command for a given code lens item.Source§fn folding_range<'life0, 'async_trait>(
&'life0 self,
params: FoldingRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<FoldingRange>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn folding_range<'life0, 'async_trait>(
&'life0 self,
params: FoldingRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<FoldingRange>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/foldingRange request is sent from the client to the server to return
all folding ranges found in a given text document. Read moreSource§fn selection_range<'life0, 'async_trait>(
&'life0 self,
params: SelectionRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SelectionRange>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn selection_range<'life0, 'async_trait>(
&'life0 self,
params: SelectionRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SelectionRange>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/selectionRange request is sent from the client to the server to return
suggested selection ranges at an array of given positions. A selection range is a range
around the cursor position which the user might be interested in selecting. Read moreSource§fn document_symbol<'life0, 'async_trait>(
&'life0 self,
params: DocumentSymbolParams,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentSymbolResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn document_symbol<'life0, 'async_trait>(
&'life0 self,
params: DocumentSymbolParams,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentSymbolResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/documentSymbol request is sent from the client to the server to
retrieve all symbols found in a given text document. Read moreSource§fn semantic_tokens_full<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn semantic_tokens_full<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/semanticTokens/full request is sent from the client to the server to
resolve the semantic tokens of a given file. Read moreSource§fn semantic_tokens_full_delta<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensDeltaParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensFullDeltaResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn semantic_tokens_full_delta<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensDeltaParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensFullDeltaResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/semanticTokens/full/delta request is sent from the client to the server to
resolve the semantic tokens of a given file, returning only the delta. Read moreSource§fn semantic_tokens_range<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensRangeResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn semantic_tokens_range<'life0, 'async_trait>(
&'life0 self,
params: SemanticTokensRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensRangeResult>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/semanticTokens/range request is sent from the client to the server to
resolve the semantic tokens for the visible range of a given file. Read moreSource§fn inline_value<'life0, 'async_trait>(
&'life0 self,
params: InlineValueParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<InlineValue>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn inline_value<'life0, 'async_trait>(
&'life0 self,
params: InlineValueParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<InlineValue>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/inlineValue request is sent from the client to the server to compute
inline values for a given text document that may be rendered in the editor at the end of
lines. Read moreSource§fn inlay_hint<'life0, 'async_trait>(
&'life0 self,
params: InlayHintParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<InlayHint>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn inlay_hint<'life0, 'async_trait>(
&'life0 self,
params: InlayHintParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<InlayHint>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/inlayHint request is sent from the client to the server to compute
inlay hints for a given (text document, range) tuple that may be rendered in the editor
in place with other text. Read moreSource§fn inlay_hint_resolve<'life0, 'async_trait>(
&'life0 self,
params: InlayHint,
) -> Pin<Box<dyn Future<Output = Result<InlayHint, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn inlay_hint_resolve<'life0, 'async_trait>(
&'life0 self,
params: InlayHint,
) -> Pin<Box<dyn Future<Output = Result<InlayHint, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
inlayHint/resolve request is sent from the client to the server to resolve
additional information for a given inlay hint. Read moreSource§fn moniker<'life0, 'async_trait>(
&'life0 self,
params: MonikerParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Moniker>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn moniker<'life0, 'async_trait>(
&'life0 self,
params: MonikerParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Moniker>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/moniker request is sent from the client to the server to get the
symbol monikers for a given text document position. Read moreSource§fn completion<'life0, 'async_trait>(
&'life0 self,
params: CompletionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<CompletionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn completion<'life0, 'async_trait>(
&'life0 self,
params: CompletionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<CompletionResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/completion request is sent from the client to the server to compute
completion items at a given cursor position. Read moreSource§fn completion_resolve<'life0, 'async_trait>(
&'life0 self,
params: CompletionItem,
) -> Pin<Box<dyn Future<Output = Result<CompletionItem, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn completion_resolve<'life0, 'async_trait>(
&'life0 self,
params: CompletionItem,
) -> Pin<Box<dyn Future<Output = Result<CompletionItem, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
completionItem/resolve request is sent from the client to the server to resolve
additional information for a given completion item.Source§fn diagnostic<'life0, 'async_trait>(
&'life0 self,
params: DocumentDiagnosticParams,
) -> Pin<Box<dyn Future<Output = Result<DocumentDiagnosticReportResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn diagnostic<'life0, 'async_trait>(
&'life0 self,
params: DocumentDiagnosticParams,
) -> Pin<Box<dyn Future<Output = Result<DocumentDiagnosticReportResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/diagnostic request is sent from the client to the server to ask the
server to compute the diagnostics for a given document. Read moreSource§fn workspace_diagnostic<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceDiagnosticParams,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiagnosticReportResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn workspace_diagnostic<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceDiagnosticParams,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiagnosticReportResult, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/diagnostic request is sent from the client to the server to ask the
server to compute workspace wide diagnostics which previously where pushed from the server
to the client. Read moreSource§fn signature_help<'life0, 'async_trait>(
&'life0 self,
params: SignatureHelpParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SignatureHelp>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn signature_help<'life0, 'async_trait>(
&'life0 self,
params: SignatureHelpParams,
) -> Pin<Box<dyn Future<Output = Result<Option<SignatureHelp>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/signatureHelp request is sent from the client to the server to request
signature information at a given cursor position.Source§fn code_action<'life0, 'async_trait>(
&'life0 self,
params: CodeActionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CodeActionOrCommand>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn code_action<'life0, 'async_trait>(
&'life0 self,
params: CodeActionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<CodeActionOrCommand>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/codeAction request is sent from the client to the server to compute
commands for a given text document and range. These commands are typically code fixes to
either fix problems or to beautify/refactor code. Read moreSource§fn code_action_resolve<'life0, 'async_trait>(
&'life0 self,
params: CodeAction,
) -> Pin<Box<dyn Future<Output = Result<CodeAction, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn code_action_resolve<'life0, 'async_trait>(
&'life0 self,
params: CodeAction,
) -> Pin<Box<dyn Future<Output = Result<CodeAction, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
codeAction/resolve request is sent from the client to the server to resolve
additional information for a given code action. Read moreSource§fn document_color<'life0, 'async_trait>(
&'life0 self,
params: DocumentColorParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<ColorInformation>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn document_color<'life0, 'async_trait>(
&'life0 self,
params: DocumentColorParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<ColorInformation>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/documentColor request is sent from the client to the server to list
all color references found in a given text document. Along with the range, a color value in
RGB is returned. Read moreSource§fn color_presentation<'life0, 'async_trait>(
&'life0 self,
params: ColorPresentationParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<ColorPresentation>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn color_presentation<'life0, 'async_trait>(
&'life0 self,
params: ColorPresentationParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<ColorPresentation>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/colorPresentation request is sent from the client to the server to
obtain a list of presentations for a color value at a given location. Read moreSource§fn formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/formatting request is sent from the client to the server to format a
whole document.Source§fn range_formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentRangeFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn range_formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentRangeFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/rangeFormatting request is sent from the client to the server to
format a given range in a document.Source§fn on_type_formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentOnTypeFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn on_type_formatting<'life0, 'async_trait>(
&'life0 self,
params: DocumentOnTypeFormattingParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/onTypeFormatting request is sent from the client to the server to
format parts of the document during typing.Source§fn rename<'life0, 'async_trait>(
&'life0 self,
params: RenameParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn rename<'life0, 'async_trait>(
&'life0 self,
params: RenameParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/rename request is sent from the client to the server to ask the server
to compute a workspace change so that the client can perform a workspace-wide rename of a
symbol.Source§fn prepare_rename<'life0, 'async_trait>(
&'life0 self,
params: TextDocumentPositionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<PrepareRenameResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn prepare_rename<'life0, 'async_trait>(
&'life0 self,
params: TextDocumentPositionParams,
) -> Pin<Box<dyn Future<Output = Result<Option<PrepareRenameResponse>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/prepareRename request is sent from the client to the server to setup
and test the validity of a rename operation at a given location. Read moreSource§fn linked_editing_range<'life0, 'async_trait>(
&'life0 self,
params: LinkedEditingRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkedEditingRanges>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn linked_editing_range<'life0, 'async_trait>(
&'life0 self,
params: LinkedEditingRangeParams,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkedEditingRanges>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
textDocument/linkedEditingRange request is sent from the client to the server to
return for a given position in a document the range of the symbol at the position and all
ranges that have the same content. Read moreSource§fn symbol<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceSymbolParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SymbolInformation>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn symbol<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceSymbolParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<SymbolInformation>>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/symbol request is sent from the client to the server to list project-wide
symbols matching the given query string. Read moreSource§fn symbol_resolve<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceSymbol,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceSymbol, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn symbol_resolve<'life0, 'async_trait>(
&'life0 self,
params: WorkspaceSymbol,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceSymbol, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspaceSymbol/resolve request is sent from the client to the server to resolve
additional information for a given workspace symbol. Read moreSource§fn did_change_configuration<'life0, 'async_trait>(
&'life0 self,
params: DidChangeConfigurationParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_change_configuration<'life0, 'async_trait>(
&'life0 self,
params: DidChangeConfigurationParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didChangeConfiguration notification is sent from the client to the server
to signal the change of configuration settings.Source§fn did_change_workspace_folders<'life0, 'async_trait>(
&'life0 self,
params: DidChangeWorkspaceFoldersParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_change_workspace_folders<'life0, 'async_trait>(
&'life0 self,
params: DidChangeWorkspaceFoldersParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didChangeWorkspaceFolders notification is sent from the client to the
server to inform about workspace folder configuration changes. Read moreSource§fn will_create_files<'life0, 'async_trait>(
&'life0 self,
params: CreateFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn will_create_files<'life0, 'async_trait>(
&'life0 self,
params: CreateFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/willCreateFiles request is sent from the client to the server before
files are actually created as long as the creation is triggered from within the client. Read moreSource§fn did_create_files<'life0, 'async_trait>(
&'life0 self,
params: CreateFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_create_files<'life0, 'async_trait>(
&'life0 self,
params: CreateFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didCreateFiles request is sent from the client to the server when files
were created from within the client.Source§fn will_rename_files<'life0, 'async_trait>(
&'life0 self,
params: RenameFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn will_rename_files<'life0, 'async_trait>(
&'life0 self,
params: RenameFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/willRenameFiles request is sent from the client to the server before
files are actually renamed as long as the rename is triggered from within the client. Read moreSource§fn did_rename_files<'life0, 'async_trait>(
&'life0 self,
params: RenameFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_rename_files<'life0, 'async_trait>(
&'life0 self,
params: RenameFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didRenameFiles notification is sent from the client to the server when
files were renamed from within the client.Source§fn will_delete_files<'life0, 'async_trait>(
&'life0 self,
params: DeleteFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn will_delete_files<'life0, 'async_trait>(
&'life0 self,
params: DeleteFilesParams,
) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/willDeleteFiles request is sent from the client to the server before
files are actually deleted as long as the deletion is triggered from within the client
either by a user action or by applying a workspace edit. Read moreSource§fn did_delete_files<'life0, 'async_trait>(
&'life0 self,
params: DeleteFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_delete_files<'life0, 'async_trait>(
&'life0 self,
params: DeleteFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didDeleteFiles notification is sent from the client to the server when
files were deleted from within the client.Source§fn did_change_watched_files<'life0, 'async_trait>(
&'life0 self,
params: DidChangeWatchedFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn did_change_watched_files<'life0, 'async_trait>(
&'life0 self,
params: DidChangeWatchedFilesParams,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/didChangeWatchedFiles notification is sent from the client to the server
when the client detects changes to files watched by the language client. Read moreSource§fn execute_command<'life0, 'async_trait>(
&'life0 self,
params: ExecuteCommandParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
params: ExecuteCommandParams,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Rc<T>: 'async_trait,
workspace/executeCommand request is sent from the client to the server to trigger
command execution on the server. Read moreSource§impl<Sp> LocalSpawn for Rc<Sp>where
Sp: LocalSpawn + ?Sized,
impl<Sp> LocalSpawn for Rc<Sp>where
Sp: LocalSpawn + ?Sized,
Source§fn spawn_local_obj(
&self,
future: LocalFutureObj<'static, ()>,
) -> Result<(), SpawnError>
fn spawn_local_obj( &self, future: LocalFutureObj<'static, ()>, ) -> Result<(), SpawnError>
Source§fn status_local(&self) -> Result<(), SpawnError>
fn status_local(&self) -> Result<(), SpawnError>
1.0.0 · Source§impl<T, A> Ord for Rc<T, A>
impl<T, A> Ord for Rc<T, A>
Source§fn cmp(&self, other: &Rc<T, A>) -> Ordering
fn cmp(&self, other: &Rc<T, A>) -> Ordering
Comparison for two Rcs.
The two are compared by calling cmp() on their inner values.
§Examples
use std::rc::Rc;
use std::cmp::Ordering;
let five = Rc::new(5);
assert_eq!(Ordering::Less, five.cmp(&Rc::new(6)));1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.0.0 · Source§impl<T, A> PartialEq for Rc<T, A>
impl<T, A> PartialEq for Rc<T, A>
Source§fn eq(&self, other: &Rc<T, A>) -> bool
fn eq(&self, other: &Rc<T, A>) -> bool
Equality for two Rcs.
Two Rcs are equal if their inner values are equal, even if they are
stored in different allocation.
If T also implements Eq (implying reflexivity of equality),
two Rcs that point to the same allocation are
always equal.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
assert!(five == Rc::new(5));Source§fn ne(&self, other: &Rc<T, A>) -> bool
fn ne(&self, other: &Rc<T, A>) -> bool
Inequality for two Rcs.
Two Rcs are not equal if their inner values are not equal.
If T also implements Eq (implying reflexivity of equality),
two Rcs that point to the same allocation are
always equal.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
assert!(five != Rc::new(6));1.0.0 · Source§impl<T, A> PartialOrd for Rc<T, A>
impl<T, A> PartialOrd for Rc<T, A>
Source§fn partial_cmp(&self, other: &Rc<T, A>) -> Option<Ordering>
fn partial_cmp(&self, other: &Rc<T, A>) -> Option<Ordering>
Partial comparison for two Rcs.
The two are compared by calling partial_cmp() on their inner values.
§Examples
use std::rc::Rc;
use std::cmp::Ordering;
let five = Rc::new(5);
assert_eq!(Some(Ordering::Less), five.partial_cmp(&Rc::new(6)));Source§fn lt(&self, other: &Rc<T, A>) -> bool
fn lt(&self, other: &Rc<T, A>) -> bool
Less-than comparison for two Rcs.
The two are compared by calling < on their inner values.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
assert!(five < Rc::new(6));Source§fn le(&self, other: &Rc<T, A>) -> bool
fn le(&self, other: &Rc<T, A>) -> bool
‘Less than or equal to’ comparison for two Rcs.
The two are compared by calling <= on their inner values.
§Examples
use std::rc::Rc;
let five = Rc::new(5);
assert!(five <= Rc::new(5));Source§impl<T> RefCnt for Pin<Rc<T>>
impl<T> RefCnt for Pin<Rc<T>>
Source§fn into_ptr(me: Pin<Rc<T>>) -> *mut T
fn into_ptr(me: Pin<Rc<T>>) -> *mut T
Source§fn as_ptr(me: &Pin<Rc<T>>) -> *mut T
fn as_ptr(me: &Pin<Rc<T>>) -> *mut T
Source§impl<T> RefCnt for Rc<T>
impl<T> RefCnt for Rc<T>
Source§fn into_ptr(me: Rc<T>) -> *mut T
fn into_ptr(me: Rc<T>) -> *mut T
Source§fn as_ptr(me: &Rc<T>) -> *mut T
fn as_ptr(me: &Rc<T>) -> *mut T
Source§impl<T, U> SerializeAs<Pin<Rc<T>>> for Pin<Rc<U>>where
U: SerializeAs<T>,
impl<T, U> SerializeAs<Pin<Rc<T>>> for Pin<Rc<U>>where
U: SerializeAs<T>,
Source§fn serialize_as<S>(
source: &Pin<Rc<T>>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Pin<Rc<T>>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl<T, U> SerializeAs<Rc<T>> for Rc<U>where
U: SerializeAs<T>,
Available on crate feature alloc only.
impl<T, U> SerializeAs<Rc<T>> for Rc<U>where
U: SerializeAs<T>,
alloc only.Source§fn serialize_as<S>(
source: &Rc<T>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Rc<T>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl<T> CloneFromCell for Rc<T>where
T: ?Sized,
impl<T, U, A> CoerceUnsized<Rc<U, A>> for Rc<T, A>
impl<T, A> DerefPure for Rc<T, A>
impl<T, U> DispatchFromDyn<Rc<U>> for Rc<T>
impl<T, A> Eq for Rc<T, A>
impl<T, A> PinCoerceUnsized for Rc<T, A>
impl<T, A> RefUnwindSafe for Rc<T, A>
impl<T, A> !Send for Rc<T, A>
impl<T, A> !Sync for Rc<T, A>
impl<T, A> Unpin for Rc<T, A>
impl<T, A> UnwindSafe for Rc<T, A>
impl<T, A> UseCloned for Rc<T, A>
Auto Trait Implementations§
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
Access::load.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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, B1, B2> HttpService<B1> for T
impl<T, B1, B2> HttpService<B1> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Sp> LocalSpawnExt for Spwhere
Sp: LocalSpawn + ?Sized,
impl<Sp> LocalSpawnExt for Spwhere
Sp: LocalSpawn + ?Sized,
Source§fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
() to
completion. Read moreSource§fn spawn_local_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>where
Fut: Future + 'static,
fn spawn_local_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>where
Fut: Future + 'static,
Source§impl<T> Source for T
impl<T> Source for T
Source§type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a>
where
T: 'a
type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a
Source can be sliced into.Source§fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
None when reading
out of bounds would occur. Read moreSource§unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
Source§fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
slice::get(range). Read moreSource§unsafe fn slice_unchecked(
&self,
range: Range<usize>,
) -> <T as Source>::Slice<'_>
unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>
slice::get_unchecked(range). Read moreSource§fn is_boundary(&self, index: usize) -> bool
fn is_boundary(&self, index: usize) -> bool
Source§impl<Sp> SpawnExt for Sp
impl<Sp> SpawnExt for Sp
Source§fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
() to
completion. Read moreSource§fn spawn_with_handle<Fut>(
&self,
future: Fut,
) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
fn spawn_with_handle<Fut>( &self, future: Fut, ) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)