Struct syntex_syntax::ptr::P [] [src]

pub struct P<T: ?Sized> {
    // some fields omitted
}

An owned smart pointer.

Methods

impl<T: 'static> P<T>
[src]

fn and_then<U, F>(self, f: F) -> U where F: FnOnce(T) -> U

Move out of the pointer. Intended for chaining transformations not covered by map.

fn unwrap(self) -> T

Equivalent to and_then(|x| x)

fn map<F>(self, f: F) -> P<T> where F: FnOnce(T) -> T

Transform the inner value, consuming self and producing a new P<T>.

impl<T> P<[T]>
[src]

fn new() -> P<[T]>

fn from_vec(v: Vec<T>) -> P<[T]>

fn into_vec(self) -> Vec<T>

Trait Implementations

impl<T> MoveMap<T> for P<[T]>
[src]

fn move_flat_map<F, I>(self, f: F) -> Self where F: FnMut(T) -> I, I: IntoIterator<Item=T>

fn move_map<F>(self, f: F) -> Self where F: FnMut(T) -> T

impl AttrMetaMethods for P<MetaItem>
[src]

fn name(&self) -> InternedString

Retrieve the name of the meta item, e.g. foo in #[foo], #[foo="bar"] and #[foo(bar)] Read more

fn value_str(&self) -> Option<InternedString>

Gets the string value if self is a MetaItemKind::NameValue variant containing a string, otherwise None. Read more

fn meta_item_list(&self) -> Option<&[P<MetaItem>]>

Gets a list of inner meta items from a list MetaItem type.

fn is_word(&self) -> bool

Indicates if the attribute is a Word.

fn is_value_str(&self) -> bool

Indicates if the attribute is a Value String.

fn is_meta_item_list(&self) -> bool

Indicates if the attribute is a Meta-Item List.

fn span(&self) -> Span

fn check_name(&self, name: &str) -> bool

impl<T: HasAttrs + 'static> HasAttrs for P<T>
[src]

fn attrs(&self) -> &[Attribute]

fn map_attrs<F: FnOnce(Vec<Attribute>) -> Vec<Attribute>>(self, f: F) -> Self

impl<T: Ord + ?Sized> Ord for P<T>
[src]

fn cmp(&self, __arg_0: &P<T>) -> Ordering

This method returns an Ordering between self and other. Read more

impl<T: PartialOrd + ?Sized> PartialOrd for P<T>
[src]

fn partial_cmp(&self, __arg_0: &P<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &P<T>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &P<T>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &P<T>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &P<T>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Eq + ?Sized> Eq for P<T>
[src]

impl<T: PartialEq + ?Sized> PartialEq for P<T>
[src]

fn eq(&self, __arg_0: &P<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &P<T>) -> bool

This method tests for !=.

impl<T: Hash + ?Sized> Hash for P<T>
[src]

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl<T: ?Sized> Deref for P<T>
[src]

type Target = T

The resulting type after dereferencing

fn deref(&self) -> &T

The method called to dereference a value

impl<T: 'static + Clone> Clone for P<T>
[src]

fn clone(&self) -> P<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: ?Sized + Debug> Debug for P<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Display> Display for P<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T> Pointer for P<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: 'static + Decodable> Decodable for P<T>
[src]

fn decode<D: Decoder>(d: &mut D) -> Result<P<T>, D::Error>

impl<T: Encodable> Encodable for P<T>
[src]

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl<T> Default for P<[T]>
[src]

fn default() -> P<[T]>

Returns the "default value" for a type. Read more

impl<T: Clone> Clone for P<[T]>
[src]

fn clone(&self) -> P<[T]>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

fn from(v: Vec<T>) -> Self

Performs the conversion.

impl<T> Into<Vec<T>> for P<[T]>
[src]

fn into(self) -> Vec<T>

Performs the conversion.

impl<T> FromIterator<T> for P<[T]>
[src]

fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> P<[T]>

Creates a value from an iterator. Read more

impl<T> IntoIterator for P<[T]>
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

impl<'a, T> IntoIterator for &'a P<[T]>
[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

impl<T: Encodable> Encodable for P<[T]>
[src]

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl<T: Decodable> Decodable for P<[T]>
[src]

fn decode<D: Decoder>(d: &mut D) -> Result<P<[T]>, D::Error>

impl ToTokens for P<Item>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>

impl ToTokens for P<ImplItem>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>

impl ToTokens for P<Expr>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>

impl ToTokens for P<Pat>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>

impl ToTokens for P<Block>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>

impl ToTokens for P<MetaItem>
[src]

fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree>