pub struct StreamTranslationEngine { /* private fields */ }Expand description
Registry-backed streaming translator.
Implementations§
Source§impl StreamTranslationEngine
impl StreamTranslationEngine
Sourcepub fn new(registry: StreamCodecRegistry) -> Self
pub fn new(registry: StreamCodecRegistry) -> Self
Creates a streaming engine from an explicit codec registry.
Sourcepub fn translate_event(
&self,
state: &mut StreamTranslationState,
source: impl Into<FormatId>,
target: impl Into<FormatId>,
event: &Value,
) -> Result<Vec<Value>>
pub fn translate_event( &self, state: &mut StreamTranslationState, source: impl Into<FormatId>, target: impl Into<FormatId>, event: &Value, ) -> Result<Vec<Value>>
Translates one source provider event into target provider events.
Sourcepub fn finish(
&self,
state: &mut StreamTranslationState,
target: impl Into<FormatId>,
) -> Result<Vec<Value>>
pub fn finish( &self, state: &mut StreamTranslationState, target: impl Into<FormatId>, ) -> Result<Vec<Value>>
Finishes target-provider stream emission after the source stream closes.
Sourcepub fn translate_event_with_builtins(
state: &mut StreamTranslationState,
source: impl Into<FormatId>,
target: impl Into<FormatId>,
event: &Value,
) -> Vec<Value>
pub fn translate_event_with_builtins( state: &mut StreamTranslationState, source: impl Into<FormatId>, target: impl Into<FormatId>, event: &Value, ) -> Vec<Value>
Convenience helper using built-in codecs and error events instead of Result.
Trait Implementations§
Source§impl Default for StreamTranslationEngine
impl Default for StreamTranslationEngine
Source§fn default() -> StreamTranslationEngine
fn default() -> StreamTranslationEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StreamTranslationEngine
impl !UnwindSafe for StreamTranslationEngine
impl Freeze for StreamTranslationEngine
impl Send for StreamTranslationEngine
impl Sync for StreamTranslationEngine
impl Unpin for StreamTranslationEngine
impl UnsafeUnpin for StreamTranslationEngine
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