[−][src]Struct rustc::ty::ClosureSubsts
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A closure can be modeled as a struct that looks like:
struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> { upvar0: U0, ... upvark: Uk }
where:
- 'l0...'li and T0...Tj are the lifetime and type parameters in scope on the function that defined the closure,
- CK represents the closure kind (Fn vs FnMut vs FnOnce). This
is rather hackily encoded via a scalar type. See
TyS::to_opt_closure_kindfor details. - CS represents the closure signature, representing as a
fn()type. For example,fn(u32, u32) -> u32would mean that the closure implementsCK<(u32, u32), Output = u32>, whereCKis the trait specified above. - U0...Uk are type parameters representing the types of its upvars
(borrowed, if appropriate; that is, if Ui represents a by-ref upvar,
and the up-var has the type
Foo, thenUi = &Foo).
So, for example, given this function:
fn foo<'a, T>(data: &'a mut T) { do(|| data.count += 1) }
the type of the closure would be something like:
struct Closure<'a, T, U0> { data: U0 }
Note that the type of the upvar is not specified in the struct. You may wonder how the impl would then be able to use the upvar, if it doesn't know it's type? The answer is that the impl is (conceptually) not fully generic over Closure but rather tied to instances with the expected upvar types:
impl<'b, 'a, T> FnMut() for Closure<'a, T, &'b mut &'a mut T> { ... }
You can see that the impl fully specified the type of the upvar
and thus knows full well that data has type &'b mut &'a mut T.
(Here, I am assuming that data is mut-borrowed.)
Now, the last question you may ask is: Why include the upvar types
as extra type parameters? The reason for this design is that the
upvar types can reference lifetimes that are internal to the
creating function. In my example above, for example, the lifetime
'b represents the scope of the closure itself; this is some
subset of foo, probably just the scope of the call to the to
do(). If we just had the lifetime/type parameters from the
enclosing function, we couldn't name this lifetime 'b. Note that
there can also be lifetimes in the types of the upvars themselves,
if one of them happens to be a reference to something that the
creating fn owns.
OK, you say, so why not create a more minimal set of parameters that just includes the extra lifetime parameters? The answer is primarily that it would be hard --- we don't know at the time when we create the closure type what the full types of the upvars are, nor do we know which are borrowed and which are not. In this design, we can just supply a fresh type parameter and figure that out later.
All right, you say, but why include the type parameters from the
original function then? The answer is that codegen may need them
when monomorphizing, and they may not appear in the upvars. A
closure could capture no variables but still make use of some
in-scope type parameter with a bound (e.g., if our example above
had an extra U: Default, and the closure called U::default()).
There is another reason. This design (implicitly) prohibits closures from capturing themselves (except via a trait object). This simplifies closure inference considerably, since it means that when we infer the kind of a closure or its upvars, we don't have to handle cycles where the decisions we make for closure C wind up influencing the decisions we ought to make for closure C (which would then require fixed point iteration to handle). Plus it fixes an ICE. :P
Generators
Perhaps surprisingly, ClosureSubsts are also used for
generators. In that case, what is written above is only half-true
-- the set of type parameters is similar, but the role of CK and
CS are different. CK represents the "yield type" and CS
represents the "return type" of the generator.
It'd be nice to split this struct into ClosureSubsts and GeneratorSubsts, I believe. -nmatsakis
Fields
substs: &'tcx Substs<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Lifetime and type parameters from the enclosing function, concatenated with the types of the upvars.
These are separated out because codegen wants to pass them around when monomorphizing.
Methods
impl<'tcx> ClosureSubsts<'tcx>[src]
impl<'tcx> ClosureSubsts<'tcx>fn split(self, def_id: DefId, tcx: TyCtxt) -> SplitClosureSubsts<'tcx>[src]
fn split(self, def_id: DefId, tcx: TyCtxt) -> SplitClosureSubsts<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Divides the closure substs into their respective components. Single source of truth with respect to the ordering.
pub fn upvar_tys(
self,
def_id: DefId,
tcx: TyCtxt
) -> impl Iterator<Item = Ty<'tcx>> + 'tcx[src]
pub fn upvar_tys(
self,
def_id: DefId,
tcx: TyCtxt
) -> impl Iterator<Item = Ty<'tcx>> + 'tcx🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn closure_kind_ty(self, def_id: DefId, tcx: TyCtxt) -> Ty<'tcx>[src]
pub fn closure_kind_ty(self, def_id: DefId, tcx: TyCtxt) -> Ty<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Returns the closure kind for this closure; may return a type
variable during inference. To get the closure kind during
inference, use infcx.closure_kind(def_id, substs).
pub fn closure_sig_ty(self, def_id: DefId, tcx: TyCtxt) -> Ty<'tcx>[src]
pub fn closure_sig_ty(self, def_id: DefId, tcx: TyCtxt) -> Ty<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Returns the type representing the closure signature for this
closure; may contain type variables during inference. To get
the closure signature during inference, use
infcx.fn_sig(def_id).
pub fn closure_kind(
self,
def_id: DefId,
tcx: TyCtxt<'_, 'tcx, 'tcx>
) -> ClosureKind[src]
pub fn closure_kind(
self,
def_id: DefId,
tcx: TyCtxt<'_, 'tcx, 'tcx>
) -> ClosureKind🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Returns the closure kind for this closure; only usable outside of an inference context, because in that context we know that there are no type variables.
If you have an inference context, use infcx.closure_kind().
pub fn closure_sig(
self,
def_id: DefId,
tcx: TyCtxt<'_, 'tcx, 'tcx>
) -> PolyFnSig<'tcx>[src]
pub fn closure_sig(
self,
def_id: DefId,
tcx: TyCtxt<'_, 'tcx, 'tcx>
) -> PolyFnSig<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Extracts the signature from the closure; only usable outside of an inference context, because in that context we know that there are no type variables.
If you have an inference context, use infcx.closure_sig().
Trait Implementations
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ClosureSubsts<'tcx>[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ClosureSubsts<'tcx>fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Relate<'tcx> for ClosureSubsts<'tcx>[src]
impl<'tcx> Relate<'tcx> for ClosureSubsts<'tcx>fn relate<'a, 'gcx, R>(
relation: &mut R,
a: &ClosureSubsts<'tcx>,
b: &ClosureSubsts<'tcx>
) -> RelateResult<'tcx, ClosureSubsts<'tcx>> where
R: TypeRelation<'a, 'gcx, 'tcx>,
'gcx: 'a + 'tcx,
'tcx: 'a, [src]
fn relate<'a, 'gcx, R>(
relation: &mut R,
a: &ClosureSubsts<'tcx>,
b: &ClosureSubsts<'tcx>
) -> RelateResult<'tcx, ClosureSubsts<'tcx>> where
R: TypeRelation<'a, 'gcx, 'tcx>,
'gcx: 'a + 'tcx,
'tcx: 'a, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'a, 'tcx> Lift<'tcx> for ClosureSubsts<'a>[src]
impl<'a, 'tcx> Lift<'tcx> for ClosureSubsts<'a>type Lifted = ClosureSubsts<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lift_to_tcx<'b, 'gcx>(
&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>
) -> Option<Self::Lifted>[src]
fn lift_to_tcx<'b, 'gcx>(
&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>
) -> Option<Self::Lifted>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> TypeFoldable<'tcx> for ClosureSubsts<'tcx>[src]
impl<'tcx> TypeFoldable<'tcx> for ClosureSubsts<'tcx>fn super_fold_with<'gcx: 'tcx, V: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut V
) -> Self[src]
fn super_fold_with<'gcx: 'tcx, V: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut V
) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool[src]
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self[src]
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool[src]
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_regions_bound_at_or_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_regions_bound_at_or_above(&self, binder: DebruijnIndex) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
True if self has any late-bound regions that are either bound by binder or bound by some binder outside of binder. If binder is ty::INNERMOST, this indicates whether there are any late-bound regions that appear free. Read more
fn has_regions_bound_above(&self, binder: DebruijnIndex) -> bool[src]
fn has_regions_bound_above(&self, binder: DebruijnIndex) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
True if this self has any regions that escape binder (and hence are not bound by it). Read more
fn has_escaping_regions(&self) -> bool[src]
fn has_escaping_regions(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_type_flags(&self, flags: TypeFlags) -> bool[src]
fn has_type_flags(&self, flags: TypeFlags) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_projections(&self) -> bool[src]
fn has_projections(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn references_error(&self) -> bool[src]
fn references_error(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_param_types(&self) -> bool[src]
fn has_param_types(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_self_ty(&self) -> bool[src]
fn has_self_ty(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_infer_types(&self) -> bool[src]
fn has_infer_types(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn needs_infer(&self) -> bool[src]
fn needs_infer(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_skol(&self) -> bool[src]
fn has_skol(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn needs_subst(&self) -> bool[src]
fn needs_subst(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_re_skol(&self) -> bool[src]
fn has_re_skol(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_closure_types(&self) -> bool[src]
fn has_closure_types(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn has_free_regions(&self) -> bool[src]
fn has_free_regions(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
"Free" regions in this context means that it has any region that is not (a) erased or (b) late-bound. Read more
fn has_erasable_regions(&self) -> bool[src]
fn has_erasable_regions(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
True if there any any un-erased free regions.
fn is_global(&self) -> bool[src]
fn is_global(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Read more
fn has_late_bound_regions(&self) -> bool[src]
fn has_late_bound_regions(&self) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
True if there are any late-bound regions
fn visit_tys_shallow(
&self,
visit: impl FnMut(Ty<'tcx>) -> bool
) -> bool[src]
fn visit_tys_shallow(
&self,
visit: impl FnMut(Ty<'tcx>) -> bool
) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A visitor that does not recurse into types, works like fn walk_shallow in Ty.
impl<'tcx> Copy for ClosureSubsts<'tcx>[src]
impl<'tcx> Copy for ClosureSubsts<'tcx>impl<'tcx> Clone for ClosureSubsts<'tcx>[src]
impl<'tcx> Clone for ClosureSubsts<'tcx>fn clone(&self) -> ClosureSubsts<'tcx>[src]
fn clone(&self) -> ClosureSubsts<'tcx>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'tcx> PartialEq for ClosureSubsts<'tcx>[src]
impl<'tcx> PartialEq for ClosureSubsts<'tcx>fn eq(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn eq(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn ne(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests for !=.
impl<'tcx> Eq for ClosureSubsts<'tcx>[src]
impl<'tcx> Eq for ClosureSubsts<'tcx>fn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl<'tcx> PartialOrd for ClosureSubsts<'tcx>[src]
impl<'tcx> PartialOrd for ClosureSubsts<'tcx>fn partial_cmp(&self, other: &ClosureSubsts<'tcx>) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &ClosureSubsts<'tcx>) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn lt(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn le(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn gt(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &ClosureSubsts<'tcx>) -> bool[src]
fn ge(&self, other: &ClosureSubsts<'tcx>) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<'tcx> Ord for ClosureSubsts<'tcx>[src]
impl<'tcx> Ord for ClosureSubsts<'tcx>fn cmp(&self, other: &ClosureSubsts<'tcx>) -> Ordering[src]
fn cmp(&self, other: &ClosureSubsts<'tcx>) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl<'tcx> Hash for ClosureSubsts<'tcx>[src]
impl<'tcx> Hash for ClosureSubsts<'tcx>fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<'tcx> Debug for ClosureSubsts<'tcx>[src]
impl<'tcx> Debug for ClosureSubsts<'tcx>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'tcx> Encodable for ClosureSubsts<'tcx>[src]
impl<'tcx> Encodable for ClosureSubsts<'tcx>fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Decodable for ClosureSubsts<'tcx>[src]
impl<'tcx> Decodable for ClosureSubsts<'tcx>Auto Trait Implementations
impl<'tcx> !Send for ClosureSubsts<'tcx>
impl<'tcx> !Send for ClosureSubsts<'tcx>impl<'tcx> !Sync for ClosureSubsts<'tcx>
impl<'tcx> !Sync for ClosureSubsts<'tcx>Blanket Implementations
impl<T> MaybeResult for T[src]
impl<T> MaybeResult for Tfn from_ok(T) -> T[src]
fn from_ok(T) -> T🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T, [src]
fn map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx, T> Subst for T where
T: TypeFoldable<'tcx>, [src]
impl<'tcx, T> Subst for T where
T: TypeFoldable<'tcx>, fn subst_spanned(
&Self,
TyCtxt<'a, 'gcx, 'tcx>,
&[Kind<'tcx>],
Option<Span>
) -> T[src]
fn subst_spanned(
&Self,
TyCtxt<'a, 'gcx, 'tcx>,
&[Kind<'tcx>],
Option<Span>
) -> T🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn subst<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
substs: &[Kind<'tcx>]
) -> Self[src]
fn subst<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
substs: &[Kind<'tcx>]
) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'a, T> Captures for T where
T: ?Sized, [src]
impl<'a, T> Captures for T where
T: ?Sized, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T[src]
fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized, [src]
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized, fn encode<E>(&self, e: &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder, [src]
fn encode<E>(&self, e: &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<T> Decodable for T where
T: UseSpecializedDecodable, [src]
impl<T> Decodable for T where
T: UseSpecializedDecodable, fn decode<D>(d: &mut D) -> Result<T, <D as Decoder>::Error> where
D: Decoder, [src]
fn decode<D>(d: &mut D) -> Result<T, <D as Decoder>::Error> where
D: Decoder, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<E> SpecializationError for E[src]
impl<E> SpecializationError for Efn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, [src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S is the encoder/decoder state type, T is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T[src]
impl<T> Erased for Timpl<T> Send for T where
T: ?Sized, [src]
impl<T> Send for T where
T: ?Sized, impl<T> Sync for T where
T: ?Sized, [src]
impl<T> Sync for T where
T: ?Sized, impl<T> Erased for T
impl<T> Erased for T