pub struct EtfDecoder<'a> { /* private fields */ }Expand description
ETF decoder.
Implementations§
Source§impl<'a> EtfDecoder<'a>
impl<'a> EtfDecoder<'a>
Sourcepub fn decode(data: &[u8]) -> Result<EtfTerm, GatewayError>
pub fn decode(data: &[u8]) -> Result<EtfTerm, GatewayError>
Decode an ETF payload into an EtfTerm.
Sourcepub fn to_json_value(term: &EtfTerm) -> Result<Value, GatewayError>
pub fn to_json_value(term: &EtfTerm) -> Result<Value, GatewayError>
Convert an EtfTerm to a serde_json::Value.
This allows ETF payloads to be processed using the same JSON-based event parsing logic.
Sourcepub fn to_json_string(term: &EtfTerm) -> Result<String, GatewayError>
pub fn to_json_string(term: &EtfTerm) -> Result<String, GatewayError>
Convert an EtfTerm to a JSON string.
Auto Trait Implementations§
impl<'a> Freeze for EtfDecoder<'a>
impl<'a> RefUnwindSafe for EtfDecoder<'a>
impl<'a> Send for EtfDecoder<'a>
impl<'a> Sync for EtfDecoder<'a>
impl<'a> Unpin for EtfDecoder<'a>
impl<'a> UnwindSafe for EtfDecoder<'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