Struct syntax_ext::deriving::generic::TraitDef[][src]

pub struct TraitDef<'a> {
    pub span: Span,
    pub attributes: Vec<Attribute>,
    pub path: Path<'a>,
    pub additional_bounds: Vec<Ty<'a>>,
    pub generics: LifetimeBounds<'a>,
    pub is_unsafe: bool,
    pub supports_unions: bool,
    pub methods: Vec<MethodDef<'a>>,
    pub associated_types: Vec<(Ident, Ty<'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?

Fields

🔬 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?

The span for the current #[derive(Foo)] header.

🔬 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?

🔬 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?

Path of the trait, including any type parameters

🔬 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?

Additional bounds required of any type parameters of the type, other than the current trait

🔬 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?

Any extra lifetimes and/or bounds, e.g. D: serialize::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?

Is it an unsafe trait?

🔬 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?

Can this trait be derived for unions?

🔬 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?

🔬 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?

Methods

impl<'a> TraitDef<'a>
[src]

🔬 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?

🔬 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?

🔬 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?

Given that we are deriving a trait DerivedTrait for a type like:

This example is not tested
struct Struct<'a, ..., 'z, A, B: DeclaredTrait, C, ..., Z> where C: WhereTrait {
    a: A,
    b: B::Item,
    b1: <B as DeclaredTrait>::Item,
    c1: <C as WhereTrait>::Item,
    c2: Option<<C as WhereTrait>::Item>,
    ...
}

create an impl like:

This example is not tested
impl<'a, ..., 'z, A, B: DeclaredTrait, C, ...  Z> where
    C:                       WhereTrait,
    A: DerivedTrait + B1 + ... + BN,
    B: DerivedTrait + B1 + ... + BN,
    C: DerivedTrait + B1 + ... + BN,
    B::Item:                 DerivedTrait + B1 + ... + BN,
    <C as WhereTrait>::Item: DerivedTrait + B1 + ... + BN,
    ...
{
    ...
}

where B1, ..., BN are the bounds given by bounds_paths.'. Z is a phantom type, and therefore does not get bound by the derived trait.

🔬 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?

🔬 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> TraitDef<'a>
[src]

🔬 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?

🔬 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?

🔬 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?

🔬 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?

Auto Trait Implementations

impl<'a> !Send for TraitDef<'a>

impl<'a> !Sync for TraitDef<'a>