pub struct ParseWithHeaderResult {
pub header: Option<HashMap<String, Value>>,
pub patterns: Vec<AstPattern>,
}Expand description
Wire type for parse_with_header across FFI boundaries (WASM and PyO3).
Serialized with serde-wasm-bindgen json_compatible() to produce
{ header: Record<string, unknown> | null, patterns: AstPattern[] } in JS,
or with pythonize to produce {"header": dict | None, "patterns": [...]} in Python.
Fields§
§header: Option<HashMap<String, Value>>§patterns: Vec<AstPattern>Implementations§
Source§impl ParseWithHeaderResult
impl ParseWithHeaderResult
Sourcepub fn from_parts(
header: Option<PropertyRecord>,
patterns: Vec<Pattern<Subject>>,
) -> Self
pub fn from_parts( header: Option<PropertyRecord>, patterns: Vec<Pattern<Subject>>, ) -> Self
Build from the output of gram_codec::parse_gram_with_header.
Sourcepub fn header_to_record(&self) -> Result<Option<PropertyRecord>, String>
pub fn header_to_record(&self) -> Result<Option<PropertyRecord>, String>
Reconstruct the header as a PropertyRecord for to_gram_with_header.
Trait Implementations§
Source§impl Clone for ParseWithHeaderResult
impl Clone for ParseWithHeaderResult
Source§fn clone(&self) -> ParseWithHeaderResult
fn clone(&self) -> ParseWithHeaderResult
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 Debug for ParseWithHeaderResult
impl Debug for ParseWithHeaderResult
Source§impl<'de> Deserialize<'de> for ParseWithHeaderResult
impl<'de> Deserialize<'de> for ParseWithHeaderResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ParseWithHeaderResult
impl RefUnwindSafe for ParseWithHeaderResult
impl Send for ParseWithHeaderResult
impl Sync for ParseWithHeaderResult
impl Unpin for ParseWithHeaderResult
impl UnsafeUnpin for ParseWithHeaderResult
impl UnwindSafe for ParseWithHeaderResult
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