pub struct SerializedAtn { /* 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 SerializedAtn
impl SerializedAtn
Sourcepub fn from_i32(values: impl Into<Vec<i32>>) -> Self
pub fn from_i32(values: impl Into<Vec<i32>>) -> Self
Creates serialized ATN data from an already-decoded integer array.
Sourcepub fn from_chars(chars: impl IntoIterator<Item = char>) -> Self
pub fn from_chars(chars: impl IntoIterator<Item = char>) -> Self
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 Clone for SerializedAtn
impl Clone for SerializedAtn
Source§fn clone(&self) -> SerializedAtn
fn clone(&self) -> SerializedAtn
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 Freeze for SerializedAtn
impl RefUnwindSafe for SerializedAtn
impl Send for SerializedAtn
impl Sync for SerializedAtn
impl Unpin for SerializedAtn
impl UnsafeUnpin for SerializedAtn
impl UnwindSafe for SerializedAtn
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