pub struct SerializedAtn<'a> { /* private fields */ }Expand description
Raw integer form of an ANTLR v4 serialized ATN.
ANTLR targets commonly embed this data as strings or integer arrays. The
Rust generator emits integer arrays from .interp files, while
from_chars supports targets that encode ATN values in string literals.
Implementations§
Source§impl<'a> SerializedAtn<'a>
impl<'a> SerializedAtn<'a>
Sourcepub const fn from_i32(values: &'a [i32]) -> Self
pub const fn from_i32(values: &'a [i32]) -> Self
Creates serialized ATN data from an already-decoded integer array.
Sourcepub fn from_chars(
chars: impl IntoIterator<Item = char>,
) -> SerializedAtn<'static>
pub fn from_chars( chars: impl IntoIterator<Item = char>, ) -> SerializedAtn<'static>
Creates serialized ATN data by widening each character to its scalar value.
This is useful for ANTLR targets that store serialized ATN data in string fragments. Java-style 16-bit word decoding is not applied here; callers should pass already-decoded characters for now.
pub fn values(&self) -> &[i32]
Trait Implementations§
Source§impl<'a> Clone for SerializedAtn<'a>
impl<'a> Clone for SerializedAtn<'a>
Source§fn clone(&self) -> SerializedAtn<'a>
fn clone(&self) -> SerializedAtn<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for SerializedAtn<'a>
impl<'a> RefUnwindSafe for SerializedAtn<'a>
impl<'a> Send for SerializedAtn<'a>
impl<'a> Sync for SerializedAtn<'a>
impl<'a> Unpin for SerializedAtn<'a>
impl<'a> UnsafeUnpin for SerializedAtn<'a>
impl<'a> UnwindSafe for SerializedAtn<'a>
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