[][src]Struct show_notes::e013::Individual

pub struct Individual<'a> {
    pub name: &'a str,
    pub age: i16,
}

An individual person defined in a way that includes a reference type.

The lifetime of the reference member, name, needs to match the lifetime of the Person itself. We'd end up with a pretty weird scenario otherwise!

Note that the lifetimes of the members match the lifetime declared for the type itself, so the references must live at least as long as the instance of the type to which they're attached.

Fields

name: &'a str

The person's name, as a string reference.

age: i16

Just in case we're talking about a character from Genesis

Methods

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

Note that the implementation block also has the lifetimes declared.

Auto Trait Implementations

impl<'a> Send for Individual<'a>

impl<'a> Unpin for Individual<'a>

impl<'a> Sync for Individual<'a>

impl<'a> RefUnwindSafe for Individual<'a>

impl<'a> UnwindSafe for Individual<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]