pub struct Relations(/* private fields */);
Expand description
A node in the syntax tree representing a $ast
Implementations§
Source§impl Relations
impl Relations
Sourcepub fn wrap_and_sort(self) -> Self
pub fn wrap_and_sort(self) -> Self
Wrap and sort this relations field
Sourcepub fn relations(&self) -> impl Iterator<Item = Relation> + '_
pub fn relations(&self) -> impl Iterator<Item = Relation> + '_
Iterate over the entries in this relations field
Sourcepub fn iter(&self) -> impl Iterator<Item = Relation> + '_
pub fn iter(&self) -> impl Iterator<Item = Relation> + '_
Iterate over the entries in this relations field
Sourcepub fn get_relation(&self, idx: usize) -> Option<Relation>
pub fn get_relation(&self, idx: usize) -> Option<Relation>
Remove the entry at the given index
Sourcepub fn remove_relation(&mut self, idx: usize) -> Relation
pub fn remove_relation(&mut self, idx: usize) -> Relation
Remove the relation at the given index
Sourcepub fn insert(&mut self, idx: usize, relation: Relation)
pub fn insert(&mut self, idx: usize, relation: Relation)
Insert a new relation at the given index
Sourcepub fn replace(&mut self, idx: usize, relation: Relation)
pub fn replace(&mut self, idx: usize, relation: Relation)
Replace the relation at the given index
Sourcepub fn parse_relaxed(s: &str) -> (Relations, Vec<String>)
pub fn parse_relaxed(s: &str) -> (Relations, Vec<String>)
Parse a relations field from a string, allowing syntax errors
Sourcepub fn satisfied_by(&self, package_version: impl VersionLookup + Copy) -> bool
pub fn satisfied_by(&self, package_version: impl VersionLookup + Copy) -> bool
Check if this relations field is satisfied by the given package versions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Relations
impl !RefUnwindSafe for Relations
impl !Send for Relations
impl !Sync for Relations
impl Unpin for Relations
impl !UnwindSafe for Relations
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
Mutably borrows from an owned value. Read more