Struct Lifetime

struct Lifetime { ... }

A Rust lifetime: 'a.

Lifetime names must conform to the following rules:

Fields

apostrophe: Span
ident: Ident

Implementations

impl Lifetime

fn new(symbol: &str, span: Span) -> Self

Panics

Panics if the lifetime does not conform to the bulleted rules above.

Invocation

# use proc_macro2::Span;
# use syn::Lifetime;
#
# fn f() -> Lifetime {
Lifetime::new("'a", Span::call_site())
# }
fn span(self: &Self) -> Span
fn set_span(self: &mut Self, span: Span)

impl Clone for Lifetime

fn clone(self: &Self) -> Self

impl Debug for Lifetime

fn fmt(self: &Self, formatter: &mut Formatter<'_>) -> Result

impl Display for Lifetime

fn fmt(self: &Self, formatter: &mut Formatter<'_>) -> Result

impl Eq for Lifetime

impl Freeze for Lifetime

impl Hash for Lifetime

fn hash<H: Hasher>(self: &Self, h: &mut H)

impl Ord for Lifetime

fn cmp(self: &Self, other: &Lifetime) -> Ordering

impl Parse for Lifetime

fn parse(input: ParseStream<'_>) -> Result<Self>

impl PartialEq for Lifetime

fn eq(self: &Self, other: &Lifetime) -> bool

impl PartialOrd for Lifetime

fn partial_cmp(self: &Self, other: &Lifetime) -> Option<Ordering>

impl RefUnwindSafe for Lifetime

impl Send for Lifetime

impl Sync for Lifetime

impl ToTokens for Lifetime

fn to_tokens(self: &Self, tokens: &mut TokenStream)

impl Token for Lifetime

impl Unpin for Lifetime

impl UnsafeUnpin for Lifetime

impl UnwindSafe for Lifetime

impl<T> Any for Lifetime

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Lifetime

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Lifetime

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Lifetime

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Lifetime

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Spanned for Lifetime

fn span(self: &Self) -> Span

impl<T> ToOwned for Lifetime

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for Lifetime

fn to_string(self: &Self) -> String

impl<T, U> Into for Lifetime

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Lifetime

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Lifetime

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>