Struct internship::Intern
[−]
[src]
pub struct Intern<T: ?Sized>(_)
where
T: AllowIntern;
Interned data
Intern<T> is conceptually same as Rc<T> but unique over its value within thread.
Methods
impl<T: ?Sized> Intern<T> where
T: AllowIntern,
&'a T: Into<Rc<T>>, [src]
T: AllowIntern,
&'a T: Into<Rc<T>>,
fn new(value: &T) -> Self[src]
Create new Intern<T> from given value, if matching cache is not found.
fn from_rc(value: Rc<T>) -> Self[src]
Create new Intern<T> from given value, reuse Rc<T> if possible.
Trait Implementations
impl FromStr for Intern<str>[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, ParseError>[src]
Parses a string s to return a value of this type. Read more
impl<'a> Add<&'a str> for Intern<str>[src]
type Output = Self
The resulting type after applying the + operator.
fn add(self, other: &'a str) -> Self[src]
Performs the + operation.
impl ToSocketAddrs for Intern<str>[src]
type Iter = <str as ToSocketAddrs>::Iter
Returned iterator over socket addresses which this type may correspond to. Read more
fn to_socket_addrs(&self) -> Result<Self::Iter>[src]
Converts this object to an iterator of resolved SocketAddrs. Read more
impl<T: ?Sized> Serialize for Intern<T> where
T: AllowIntern + Serialize, [src]
T: AllowIntern + Serialize,
fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>[src]
Serialize this value into the given Serde serializer. Read more
impl<'de, T> Deserialize<'de> for Intern<T> where
T: AllowIntern + ToOwned,
&'a T: Into<Rc<T>>,
<T as ToOwned>::Owned: Deserialize<'de> + Into<Rc<T>> + Hash + Eq, [src]
T: AllowIntern + ToOwned,
&'a T: Into<Rc<T>>,
<T as ToOwned>::Owned: Deserialize<'de> + Into<Rc<T>> + Hash + Eq,
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>[src]
Deserialize this value from the given Serde deserializer. Read more
impl<'de> Deserialize<'de> for Intern<str>[src]
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>[src]
Deserialize this value from the given Serde deserializer. Read more
impl<'de> Deserialize<'de> for Intern<[u8]>[src]
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>[src]
Deserialize this value from the given Serde deserializer. Read more
impl<T: Debug + ?Sized> Debug for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
impl<T: Eq + ?Sized> Eq for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
impl<T: PartialOrd + ?Sized> PartialOrd for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
fn partial_cmp(&self, __arg_0: &Intern<T>) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &Intern<T>) -> bool[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &Intern<T>) -> bool[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &Intern<T>) -> bool[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &Intern<T>) -> bool[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T: Ord + ?Sized> Ord for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
fn cmp(&self, __arg_0: &Intern<T>) -> Ordering[src]
This method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<T: Default + ?Sized> Default for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
impl<T: ?Sized, U> From<U> for Intern<T> where
T: AllowIntern,
&'a T: Into<Rc<T>>,
U: Into<Rc<T>> + Borrow<T>, [src]
T: AllowIntern,
&'a T: Into<Rc<T>>,
U: Into<Rc<T>> + Borrow<T>,
impl<T: ?Sized> Clone for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
fn clone(&self) -> Self[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T: ?Sized> Deref for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
Dereferences the value.
impl<T: ?Sized> Drop for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
impl<T: ?Sized> PartialEq<Self> for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
fn eq(&self, other: &Self) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<T: ?Sized> Hash for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
fn hash<H: Hasher>(&self, hasher: &mut H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl<T: ?Sized> AsRef<T> for Intern<T> where
T: AllowIntern, [src]
T: AllowIntern,
impl<T: ?Sized> Display for Intern<T> where
T: AllowIntern + Display, [src]
T: AllowIntern + Display,