pub struct UnionTypeExtension<'src> {
pub directives: Vec<DirectiveAnnotation<'src>>,
pub members: Vec<Name<'src>>,
pub name: Name<'src>,
pub span: ByteSpan,
pub syntax: Option<Box<UnionTypeExtensionSyntax<'src>>>,
}Expand description
A union type extension.
See Union Extensions in the spec.
§Spec invariant
The spec’s directives-only form
(extend union Name Directives[Const]) requires at
least one directive when no members are present.
For a spec-valid node, directives and members
are never both empty.
Fields§
§directives: Vec<DirectiveAnnotation<'src>>§members: Vec<Name<'src>>§name: Name<'src>§span: ByteSpan§syntax: Option<Box<UnionTypeExtensionSyntax<'src>>>Implementations§
Source§impl<'src> UnionTypeExtension<'src>
impl<'src> UnionTypeExtension<'src>
Sourcepub fn name_value(&self) -> &str
pub fn name_value(&self) -> &str
Returns the name of this union type extension as a string slice.
Convenience accessor for self.name.value.
Source§impl UnionTypeExtension<'_>
impl UnionTypeExtension<'_>
Sourcepub fn append_source(&self, sink: &mut String, source: Option<&str>)
pub fn append_source(&self, sink: &mut String, source: Option<&str>)
Sourcepub fn byte_span(&self) -> ByteSpan
pub fn byte_span(&self) -> ByteSpan
Returns this union type extension’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Sourcepub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
pub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Trait Implementations§
Source§impl AstNode for UnionTypeExtension<'_>
impl AstNode for UnionTypeExtension<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this union type extension’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Source§fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Source§impl<'src> Clone for UnionTypeExtension<'src>
impl<'src> Clone for UnionTypeExtension<'src>
Source§fn clone(&self) -> UnionTypeExtension<'src>
fn clone(&self) -> UnionTypeExtension<'src>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'src> Debug for UnionTypeExtension<'src>
impl<'src> Debug for UnionTypeExtension<'src>
Source§impl<'src> PartialEq for UnionTypeExtension<'src>
impl<'src> PartialEq for UnionTypeExtension<'src>
impl<'src> StructuralPartialEq for UnionTypeExtension<'src>
Auto Trait Implementations§
impl<'src> Freeze for UnionTypeExtension<'src>
impl<'src> RefUnwindSafe for UnionTypeExtension<'src>
impl<'src> Send for UnionTypeExtension<'src>
impl<'src> Sync for UnionTypeExtension<'src>
impl<'src> Unpin for UnionTypeExtension<'src>
impl<'src> UnsafeUnpin for UnionTypeExtension<'src>
impl<'src> UnwindSafe for UnionTypeExtension<'src>
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