Struct librsnek::system::rc::impl_single_threaded::StrongRc 1.0.0
[−]
[src]
pub struct StrongRc<T> where
T: ?Sized, {
ptr: Shared<RcBox<T>>,
}
A single-threaded reference-counting pointer.
Fields
ptr: Shared<RcBox<T>>
Methods
impl<T> Rc<T>
[src]
fn new(value: T) -> Rc<T>
Constructs a new Rc<T>
.
fn try_unwrap(this: Rc<T>) -> Result<T, Rc<T>>
1.4.0
Returns the contained value, if the Rc
has exactly one strong reference.
fn into_raw(this: Rc<T>) -> *const T
1.17.0
Consumes the Rc
, returning the wrapped pointer.
unsafe fn from_raw(ptr: *const T) -> Rc<T>
1.17.0
Constructs an Rc
from a raw pointer.
impl Rc<str>
[src]
fn __from_str(value: &str) -> Rc<str>
🔬 This is a nightly-only experimental API. (rustc_private
)
for internal use in rustc
Constructs a new Rc<str>
from a string slice.
impl<T> Rc<[T]>
[src]
fn __from_array(value: Box<[T]>) -> Rc<[T]>
🔬 This is a nightly-only experimental API. (rustc_private
)
for internal use in rustc
Constructs a new Rc<[T]>
from a Box<[T]>
.
impl<T> Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
fn downgrade(this: &Rc<T>) -> Weak<T>
1.4.0
Creates a new [Weak
][weak] pointer to this value.
fn weak_count(this: &Rc<T>) -> usize
1.15.0
Gets the number of [Weak
][weak] pointers to this value.
fn strong_count(this: &Rc<T>) -> usize
1.15.0
Gets the number of strong (Rc
) pointers to this value.
fn get_mut(this: &mut Rc<T>) -> Option<&mut T>
1.4.0
Returns a mutable reference to the inner value, if there are
fn ptr_eq(this: &Rc<T>, other: &Rc<T>) -> bool
1.17.0
Returns true if the two Rc
s point to the same value (not
impl<T> Rc<T> where
T: Clone,
[src]
T: Clone,
Trait Implementations
impl<C> Completer for Rc<C> where
C: Completer + ?Sized,
[src]
C: Completer + ?Sized,
fn complete(
&self,
line: &str,
pos: usize
) -> Result<(usize, Vec<String>), ReadlineError>
&self,
line: &str,
pos: usize
) -> Result<(usize, Vec<String>), ReadlineError>
fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)
impl<T> UnwindSafe for Rc<T> where
T: RefUnwindSafe + ?Sized,
1.9.0[src]
T: RefUnwindSafe + ?Sized,
impl<T> !Sync for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
impl<T> AsRef<T> for Rc<T> where
T: ?Sized,
1.5.0[src]
T: ?Sized,
fn as_ref(&self) -> &T
Performs the conversion.
impl<T> Display for Rc<T> where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> Borrow<T> for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
fn borrow(&self) -> &T
Immutably borrows from an owned value.
impl<T> Hash for Rc<T> where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
H: Hasher,
Feeds this value into the given [Hasher
].
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
].
impl<T> Ord for Rc<T> where
T: Ord + ?Sized,
[src]
T: Ord + ?Sized,
impl<T> Eq for Rc<T> where
T: Eq + ?Sized,
[src]
T: Eq + ?Sized,
fn assert_receiver_is_total_eq(&self)
impl<T> From<T> for Rc<T>
1.6.0[src]
impl<T> Drop for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
fn drop(&mut self)
Drops the Rc
.
impl<T, U> CoerceUnsized<Rc<U>> for Rc<T> where
T: Unsize<U> + ?Sized,
U: ?Sized,
[src]
T: Unsize<U> + ?Sized,
U: ?Sized,
impl<T> Clone for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
fn clone(&self) -> Rc<T>
Makes a clone of the Rc
pointer.
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
.
impl<T> PartialOrd<Rc<T>> for Rc<T> where
T: PartialOrd<T> + ?Sized,
[src]
T: PartialOrd<T> + ?Sized,
fn partial_cmp(&self, other: &Rc<T>) -> Option<Ordering>
Partial comparison for two Rc
s.
fn lt(&self, other: &Rc<T>) -> bool
Less-than comparison for two Rc
s.
fn le(&self, other: &Rc<T>) -> bool
'Less than or equal to' comparison for two Rc
s.
fn gt(&self, other: &Rc<T>) -> bool
Greater-than comparison for two Rc
s.
fn ge(&self, other: &Rc<T>) -> bool
'Greater than or equal to' comparison for two Rc
s.
impl<T> Pointer for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
impl<T> PartialEq<Rc<T>> for Rc<T> where
T: PartialEq<T> + ?Sized,
[src]
T: PartialEq<T> + ?Sized,
fn eq(&self, other: &Rc<T>) -> bool
Equality for two Rc
s.
fn ne(&self, other: &Rc<T>) -> bool
Inequality for two Rc
s.
impl<T> Debug for Rc<T> where
T: Debug + ?Sized,
[src]
T: Debug + ?Sized,
impl<T> Deref for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T> Default for Rc<T> where
T: Default,
[src]
T: Default,
impl<T> !Send for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Encodable for Rc<T> where
T: Encodable,
[src]
T: Encodable,
impl<T> Decodable for Rc<T> where
T: Decodable,
[src]
T: Decodable,
impl<T> Value for Rc<T> where
T: Value,
[src]
T: Value,