pub struct StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,{ /* private fields */ }
Expand description
This is what is used internally take care of input and manage flushing and handling retries.
Implementations§
Source§impl<S, T> StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
impl<S, T> StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
Sourcepub fn feed(&mut self, input: &T)
pub fn feed(&mut self, input: &T)
Takes the log events and processes it in the state. Note that it does not guarantee that the event will be processed immediately. In some situations the event will be queued when the state things it is better able to process the event, but it doesn’t do this automatically. For those events to be processed, you need to call StateContainer::flush. This will go through the remaining events and tries to process them.
Sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Processes any left-over events that were scheduled for later processing. Call this sparingly especially not while you’re also still reading a lot of events through StateContainer::feed as that will likely cause performance issues.
Trait Implementations§
Source§impl<S, T> Debug for StateContainer<S, T>
impl<S, T> Debug for StateContainer<S, T>
Source§impl<S, T> Default for StateContainer<S, T>
impl<S, T> Default for StateContainer<S, T>
Source§impl<S, T> DerefMut for StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
impl<S, T> DerefMut for StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
Source§impl<'de, S, T> Deserialize<'de> for StateContainer<S, T>where
S: StateResolver<T> + Deserialize<'de>,
T: Clone,
impl<'de, S, T> Deserialize<'de> for StateContainer<S, T>where
S: StateResolver<T> + Deserialize<'de>,
T: Clone,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<S, T> From<S> for StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
impl<S, T> From<S> for StateContainer<S, T>where
S: StateResolver<T>,
T: Clone,
Source§impl<S, T> Serialize for StateContainer<S, T>
impl<S, T> Serialize for StateContainer<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for StateContainer<S, T>where
S: Freeze,
impl<S, T> RefUnwindSafe for StateContainer<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for StateContainer<S, T>
impl<S, T> Sync for StateContainer<S, T>
impl<S, T> Unpin for StateContainer<S, T>
impl<S, T> UnwindSafe for StateContainer<S, T>where
S: UnwindSafe,
T: UnwindSafe,
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