[−][src]Struct darling::util::IdentList
A list of syn::Ident
instances. This type is used to extract a list of words from an
attribute.
Usage
An IdentList
field on a struct implementing FromMeta
will turn #[builder(derive(Debug, Clone))]
into:
StructOptions { derive: IdentList(vec![syn::Ident::new("Debug"), syn::Ident::new("Clone")]) }
Methods
impl IdentList
[src]
pub fn new<T>(vals: Vec<T>) -> IdentList where
T: Into<Ident>,
[src]
T: Into<Ident>,
Create a new list.
pub fn to_strings(&self) -> Vec<String>
[src]
Create a new Vec
containing the string representation of each ident.
Methods from Deref<Target = Vec<Ident>>
pub fn capacity(&self) -> usize
1.0.0[src]
Returns the number of elements the vector can hold without reallocating.
Examples
let vec: Vec<i32> = Vec::with_capacity(10); assert_eq!(vec.capacity(), 10);
pub fn as_slice(&self) -> &[T]
1.7.0[src]
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
Examples
use std::io::{self, Write}; let buffer = vec![1, 2, 3, 5, 8]; io::sink().write(buffer.as_slice()).unwrap();
pub fn len(&self) -> usize
1.0.0[src]
Returns the number of elements in the vector, also referred to as its 'length'.
Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
pub fn is_empty(&self) -> bool
1.0.0[src]
Returns true
if the vector contains no elements.
Examples
let mut v = Vec::new(); assert!(v.is_empty()); v.push(1); assert!(!v.is_empty());
Trait Implementations
impl PartialEq<IdentList> for IdentList
[src]
impl FromMeta for IdentList
[src]
fn from_list(v: &[NestedMeta]) -> Result<IdentList, Error>
[src]
fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
[src]
fn from_meta(item: &Meta) -> Result<Self, Error>
[src]
Create an instance from a syn::Meta
by dispatching to the format-appropriate trait function. This generally should not be overridden by implementers. Read more
fn from_word() -> Result<Self, Error>
[src]
Create an instance from the presence of the word in the attribute with no additional options specified. Read more
fn from_value(value: &Lit) -> Result<Self, Error>
[src]
Create an instance from a literal value of either foo = "bar"
or foo("bar")
. This dispatches to the appropriate method based on the type of literal encountered, and generally should not be overridden by implementers. Read more
fn from_char(value: char) -> Result<Self, Error>
[src]
Create an instance from a char literal in a value position.
fn from_string(value: &str) -> Result<Self, Error>
[src]
Create an instance from a string literal in a value position.
fn from_bool(value: bool) -> Result<Self, Error>
[src]
Create an instance from a bool literal in a value position.
impl Clone for IdentList
[src]
fn clone(&self) -> IdentList
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<Vec<Ident>> for IdentList
[src]
impl Debug for IdentList
[src]
impl Eq for IdentList
[src]
impl Default for IdentList
[src]
impl Deref for IdentList
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,