#[repr(transparent)]pub struct Sequence<T> {
pub nodes: Vec<T>,
}Expand description
Represents a sequence of nodes.
An example of this is modifiers in a method declaration.
i.e. public and static in public static function foo() {}.
Fields§
§nodes: Vec<T>Implementations§
Source§impl Sequence<ClassLikeMember>
impl Sequence<ClassLikeMember>
pub fn contains_trait_uses(&self) -> bool
pub fn contains_constants(&self) -> bool
pub fn contains_properties(&self) -> bool
pub fn contains_enum_cases(&self) -> bool
pub fn contains_methods(&self) -> bool
Source§impl Sequence<Modifier>
impl Sequence<Modifier>
Sourcepub fn get_static(&self) -> Option<&Modifier>
pub fn get_static(&self) -> Option<&Modifier>
Returns the first abstract modifier in the sequence, if any.
Sourcepub fn contains_static(&self) -> bool
pub fn contains_static(&self) -> bool
Returns true if the sequence contains a static modifier.
Sourcepub fn get_final(&self) -> Option<&Modifier>
pub fn get_final(&self) -> Option<&Modifier>
Return the first final modifier in the sequence, if any.
Sourcepub fn contains_final(&self) -> bool
pub fn contains_final(&self) -> bool
Returns true if the sequence contains a final modifier.
Sourcepub fn get_abstract(&self) -> Option<&Modifier>
pub fn get_abstract(&self) -> Option<&Modifier>
Returns the first abstract modifier in the sequence, if any.
Sourcepub fn contains_abstract(&self) -> bool
pub fn contains_abstract(&self) -> bool
Returns true if the sequence contains an abstract modifier.
Sourcepub fn get_readonly(&self) -> Option<&Modifier>
pub fn get_readonly(&self) -> Option<&Modifier>
Returns the first abstract modifier in the sequence, if any.
Sourcepub fn contains_readonly(&self) -> bool
pub fn contains_readonly(&self) -> bool
Returns true if the sequence contains a readonly modifier.
pub fn get_first_visibility(&self) -> Option<&Modifier>
pub fn get_first_read_visibility(&self) -> Option<&Modifier>
pub fn get_first_write_visibility(&self) -> Option<&Modifier>
Sourcepub fn contains_visibility(&self) -> bool
pub fn contains_visibility(&self) -> bool
Returns true if the sequence contains a visibility modifier for reading or writing.
pub fn get_public(&self) -> Option<&Modifier>
Sourcepub fn contains_public(&self) -> bool
pub fn contains_public(&self) -> bool
Returns true if the sequence contains a public visibility modifier.
pub fn get_protected(&self) -> Option<&Modifier>
Sourcepub fn contains_protected(&self) -> bool
pub fn contains_protected(&self) -> bool
Returns true if the sequence contains a protected visibility modifier.
pub fn get_private(&self) -> Option<&Modifier>
Sourcepub fn contains_private(&self) -> bool
pub fn contains_private(&self) -> bool
Returns true if the sequence contains a private visibility modifier.
pub fn get_private_set(&self) -> Option<&Modifier>
pub fn contains_private_set(&self) -> bool
pub fn get_protected_set(&self) -> Option<&Modifier>
pub fn contains_protected_set(&self) -> bool
pub fn get_public_set(&self) -> Option<&Modifier>
pub fn contains_public_set(&self) -> bool
Source§impl<T: HasSpan> Sequence<T>
impl<T: HasSpan> Sequence<T>
pub const fn new(inner: Vec<T>) -> Self
pub const fn empty() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<&T>
pub fn first(&self) -> Option<&T>
pub fn first_span(&self) -> Option<Span>
pub fn last(&self) -> Option<&T>
pub fn last_span(&self) -> Option<Span>
pub fn span(&self, from: Position) -> Span
pub fn iter(&self) -> Iter<'_, T>
pub fn as_slice(&self) -> &[T]
pub fn to_vec(&self) -> Vec<&T>
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Sequence<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Sequence<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<T: HasSpan> FromIterator<T> for Sequence<T>
impl<T: HasSpan> FromIterator<T> for Sequence<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl<T: HasSpan> IntoIterator for Sequence<T>
impl<T: HasSpan> IntoIterator for Sequence<T>
Source§impl<T: Ord> Ord for Sequence<T>
impl<T: Ord> Ord for Sequence<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialOrd> PartialOrd for Sequence<T>
impl<T: PartialOrd> PartialOrd for Sequence<T>
impl<T: Eq> Eq for Sequence<T>
impl<T> StructuralPartialEq for Sequence<T>
Auto Trait Implementations§
impl<T> Freeze for Sequence<T>
impl<T> RefUnwindSafe for Sequence<T>where
T: RefUnwindSafe,
impl<T> Send for Sequence<T>where
T: Send,
impl<T> Sync for Sequence<T>where
T: Sync,
impl<T> Unpin for Sequence<T>where
T: Unpin,
impl<T> UnwindSafe for Sequence<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more