ByteSink

Struct ByteSink 

Source
pub struct ByteSink<W: Write, Factory: VerdictFactory<MonitorOutput, OutputTime, Record = Verdict>, MonitorOutput: VerdictRepresentation, OutputTime: OutputTimeRepresentation, Verdict: Into<Vec<u8>>> { /* private fields */ }
Expand description

Generic VerdictSink that accepts verdicts as bytes and writes them to a Writer.

Implementations§

Source§

impl<W: Write, Factory: VerdictFactory<MonitorOutput, OutputTime, Record = Verdict>, MonitorOutput: VerdictRepresentation, OutputTime: OutputTimeRepresentation, Verdict: Into<Vec<u8>>> ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>

Source

pub fn new(writer: W, factory: Factory) -> Self

Create a new ByteSink that receives bytes and forwards them to a writer

Trait Implementations§

Source§

impl<W: Debug + Write, Factory: Debug + VerdictFactory<MonitorOutput, OutputTime, Record = Verdict>, MonitorOutput: Debug + VerdictRepresentation, OutputTime: Debug + OutputTimeRepresentation, Verdict: Debug + Into<Vec<u8>>> Debug for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: Write, Factory: VerdictFactory<MonitorOutput, OutputTime, Record = Verdict>, MonitorOutput: VerdictRepresentation, OutputTime: OutputTimeRepresentation, Verdict: Into<Vec<u8>>> VerdictsSink<MonitorOutput, OutputTime> for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>

Source§

type Error = Error

Error Type of a VerdictsSink implementation
Source§

type Factory = Factory

Factory Type to convert the monitor output to the required representation
Source§

type Return = ()

Return Type of a VerdictsSink implementation
Source§

fn sink(&mut self, verdict: Verdict) -> Result<Self::Return, Self::Error>

Function to dispatch the converted verdict to the sink
Source§

fn factory(&mut self) -> &mut Self::Factory

Function to return a reference to the Verdictfactory
Source§

fn sink_verdicts( &mut self, verdicts: Verdicts<V, T>, ) -> Result<Vec<Self::Return>, VerdictSinkError<Self::Error, <Self::Factory as VerdictFactory<V, T>>::Error>>

Defines how the verdicts of the monitor needs to be handled
Source§

fn sink_verdict( &mut self, ts: <T as TimeRepresentation>::InnerTime, verdict: V, ) -> Result<Self::Return, VerdictSinkError<Self::Error, <Self::Factory as VerdictFactory<V, T>>::Error>>

Defines how one verdict of the monitor needs to be handled, timed and event-based

Auto Trait Implementations§

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> Freeze for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: Freeze, W: Freeze,

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> RefUnwindSafe for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: RefUnwindSafe, W: RefUnwindSafe, MonitorOutput: RefUnwindSafe, OutputTime: RefUnwindSafe,

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> Send for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: Send, W: Send,

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> Sync for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: Sync, W: Sync, MonitorOutput: Sync, OutputTime: Sync,

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> Unpin for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: Unpin, W: Unpin, MonitorOutput: Unpin, OutputTime: Unpin,

§

impl<W, Factory, MonitorOutput, OutputTime, Verdict> UnwindSafe for ByteSink<W, Factory, MonitorOutput, OutputTime, Verdict>
where Factory: UnwindSafe, W: UnwindSafe, MonitorOutput: UnwindSafe, OutputTime: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> CondDeserialize for T

Source§

impl<T> CondSerialize for T