Struct schema_registry_converter::blocking::proto_decoder::ProtoDecoder [−][src]
Implementations
impl ProtoDecoder
[src]
pub fn new(sr_settings: SrSettings) -> ProtoDecoder
[src]
Creates a new decoder which will use the supplied url used in creating the sr settings to fetch the schema's since the schema needed is encoded in the binary, independent of the SubjectNameStrategy we don't need any additional data. It's possible for recoverable errors to stay in the cache, when a result comes back as an error you can use remove_errors_from_cache to clean the cache, keeping the correctly fetched schema's
pub fn remove_errors_from_cache(&mut self)
[src]
Remove al the errors from the cache, you might need to/want to run this when a recoverable error is met. Errors are also cashed to prevent trying to get schema's that either don't exist or can't be parsed.
pub fn decode(&mut self, bytes: Option<&[u8]>) -> Result<Value, SRCError>
[src]
Decodes bytes into a value. The choice to use Option<&u8> as type us made so it plays nice with the BorrowedMessage struct from rdkafka, for example if we have m: &'a BorrowedMessage and decoder: &'a mut Decoder we can use decoder.decode(m.payload()) to decode the payload or decoder.decode(m.key()) to get the decoded key.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ProtoDecoder
[src]
impl Send for ProtoDecoder
[src]
impl Sync for ProtoDecoder
[src]
impl Unpin for ProtoDecoder
[src]
impl !UnwindSafe for ProtoDecoder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,