pub struct Set(/* private fields */);Expand description
A virtual AST node for YAML sets (!!set tagged scalars)
Implementations§
Source§impl Set
impl Set
Sourcepub fn cast(node: SyntaxNode<Lang>) -> Option<Self>
pub fn cast(node: SyntaxNode<Lang>) -> Option<Self>
Cast a SyntaxNode to a Set only if it’s a TAGGED_NODE with !!set tag
Sourcepub fn members(&self) -> impl Iterator<Item = YamlNode> + '_
pub fn members(&self) -> impl Iterator<Item = YamlNode> + '_
Iterate over the set members, preserving formatting.
Each member is yielded as a YamlNode wrapping the
key content node (the scalar, mapping, or sequence that forms the set
member). The iteration order follows the document order.
To compare members semantically (ignoring quoting style), use
yaml_eq on the returned nodes.
Note: !!set entries appear in two CST layouts: explicit-key ? item
(KEY/VALUE as direct MAPPING children) and implicit item: null
(KEY/VALUE inside MAPPING_ENTRY). Both are handled.
Trait Implementations§
impl Eq for Set
impl StructuralPartialEq for Set
Auto Trait Implementations§
impl Freeze for Set
impl !RefUnwindSafe for Set
impl !Send for Set
impl !Sync for Set
impl Unpin for Set
impl UnsafeUnpin for Set
impl !UnwindSafe for Set
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