pub struct RuntimeCodecPrism { /* private fields */ }Expand description
Runtime-backed CodecPrism for an installed codec symbol.
Implementations§
Source§impl RuntimeCodecPrism
impl RuntimeCodecPrism
Sourcepub fn domain(codec: Symbol, domain: impl Into<String>) -> Self
pub fn domain(codec: Symbol, domain: impl Into<String>) -> Self
Builds a fail-closed prism for a domain codec.
Sourcepub fn binary_base64(codec: Symbol) -> Self
pub fn binary_base64(codec: Symbol) -> Self
Builds a prism for the base64 text wrapper around binary frames.
Sourcepub fn parse_bytes(&self, cx: &mut Cx, bytes: &[u8]) -> PrismParse
pub fn parse_bytes(&self, cx: &mut Cx, bytes: &[u8]) -> PrismParse
Parses raw bytes. Text codecs receive UTF-8 validation from the codec runtime; binary codecs inspect the bytes as untrusted frame data.
Sourcepub fn round_trip_bytes(
&self,
cx: &mut Cx,
bytes: &[u8],
position: EncodePosition,
) -> RoundTrip
pub fn round_trip_bytes( &self, cx: &mut Cx, bytes: &[u8], position: EncodePosition, ) -> RoundTrip
Parses, encodes, and reparses raw bytes to prove semantic identity.
Trait Implementations§
Source§impl Clone for RuntimeCodecPrism
impl Clone for RuntimeCodecPrism
Source§fn clone(&self) -> RuntimeCodecPrism
fn clone(&self) -> RuntimeCodecPrism
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 moreSource§impl CodecPrism for RuntimeCodecPrism
impl CodecPrism for RuntimeCodecPrism
Source§fn parse(&self, cx: &mut Cx, text: &str) -> PrismParse
fn parse(&self, cx: &mut Cx, text: &str) -> PrismParse
Parses text into a semantic expression id, span map, and diagnostics.
Source§fn encode(
&self,
cx: &mut Cx,
id: &SemanticId,
position: EncodePosition,
) -> PrismEncode
fn encode( &self, cx: &mut Cx, id: &SemanticId, position: EncodePosition, ) -> PrismEncode
Encodes a parsed semantic id at a target output position.
Source§fn round_trip(
&self,
cx: &mut Cx,
text: &str,
position: EncodePosition,
) -> RoundTrip
fn round_trip( &self, cx: &mut Cx, text: &str, position: EncodePosition, ) -> RoundTrip
Parses, encodes, and reparses text to prove semantic identity.
Source§impl Debug for RuntimeCodecPrism
impl Debug for RuntimeCodecPrism
impl Eq for RuntimeCodecPrism
Source§impl PartialEq for RuntimeCodecPrism
impl PartialEq for RuntimeCodecPrism
Source§fn eq(&self, other: &RuntimeCodecPrism) -> bool
fn eq(&self, other: &RuntimeCodecPrism) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RuntimeCodecPrism
Auto Trait Implementations§
impl Freeze for RuntimeCodecPrism
impl RefUnwindSafe for RuntimeCodecPrism
impl Send for RuntimeCodecPrism
impl Sync for RuntimeCodecPrism
impl Unpin for RuntimeCodecPrism
impl UnsafeUnpin for RuntimeCodecPrism
impl UnwindSafe for RuntimeCodecPrism
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