Struct TypeTraitObject
pub struct TypeTraitObject { pub attrs: Vec<Attribute>, pub dyn_token: Option<Dyn>, pub bounds: Punctuated<TypeParamBound, Plus> }
A trait object type dyn Bound1 + Bound2 + Bound3 where Bound is a
trait or a lifetime.
Fields
attrs: Vec<Attribute>dyn_token: Option<Dyn>The
dynkeyword is required since Rust 2021 edition. In editions 2015–2018, trait objects without adynkeyword are allowed but deprecated.bounds: Punctuated<TypeParamBound, Plus>
Implementations
impl TypeTraitObject
fn without_plus(input: ParseStream<'_>) -> Result<Self>
Trait Implementations
impl Clone for TypeTraitObject
fn clone(&self) -> Self
impl Parse for TypeTraitObject
fn parse(input: ParseStream<'_>) -> Result<Self>
impl ToTokens for TypeTraitObject
fn to_tokens(&self, tokens: &mut TokenStream)
Auto Trait Implementations
impl !Send for TypeTraitObject
impl !Sync for TypeTraitObject
impl Freeze for TypeTraitObject
impl RefUnwindSafe for TypeTraitObject
impl Unpin for TypeTraitObject
impl UnsafeUnpin for TypeTraitObject
impl UnwindSafe for TypeTraitObject
Blanket Implementations
impl<T> Any for TypeTraitObject
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for TypeTraitObject
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for TypeTraitObject
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for TypeTraitObject
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for TypeTraitObject
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Spanned for TypeTraitObject
where
T: Spanned + ?Sized,
fn span(&self) -> Span
impl<T> ToOwned for TypeTraitObject
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for TypeTraitObject
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for TypeTraitObject
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for TypeTraitObject
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>