[−][src]Struct ll::OngoingEvent
Implementations
impl OngoingEvent
[src]
Public event that is passed to a logger call closure
l.event("my_event", |ongoing_event| { ... });
This struct has an API that can modify the underlying Event
object, which is not
public.
pub fn add_data<K, V>(&self, key: K, value: V) -> &Self where
K: Into<String>,
V: Into<DataValue>,
[src]
K: Into<String>,
V: Into<DataValue>,
Add a piece of data associated with the event. This data will be logged together with the event.
let l = ll::Logger::new(); l.event("some_event", |e| { e.add_data("random_counter", 5); // it also supports hashtag, which can be handled by provided Drain // implementations during logging. e.add_data("dont_print_this_data #dontprint", true); Ok(()) }).unwrap();
pub fn set_error_msg<S: Into<String>>(&self, msg: S)
[src]
Sets an error message for the event as a separate field.
let l = ll::Logger::new(); l.event("some_event", |e| { e.set_error_msg("It crashed!!!"); Ok(()) }).unwrap();
pub fn discard(&self)
[src]
Discard an event manually. After calling this function will not be logged.
pub fn event<E: Into<String>, F, T>(&self, event_name: E, f: F) -> Result<T> where
F: FnOnce(OngoingEvent) -> Result<T>,
[src]
F: FnOnce(OngoingEvent) -> Result<T>,
pub async fn async_event<E: Into<String>, FN, FT, T, '_>(
&'_ self,
event_name: E,
f: FN
) -> Result<T> where
FN: FnOnce(OngoingEvent) -> FT,
FT: Future<Output = Result<T>>,
[src]
&'_ self,
event_name: E,
f: FN
) -> Result<T> where
FN: FnOnce(OngoingEvent) -> FT,
FT: Future<Output = Result<T>>,
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for OngoingEvent
impl Send for OngoingEvent
impl Sync for OngoingEvent
impl Unpin for OngoingEvent
impl UnwindSafe for OngoingEvent
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,