Struct KeepAlive
struct KeepAlive { ... }
Configure the interval between keep-alive messages, the content of each message, and the associated stream.
Implementations
impl KeepAlive
fn new() -> SelfCreate a new
KeepAlive.fn interval(self: Self, time: Duration) -> SelfCustomize the interval between keep-alive messages.
Default is 15 seconds.
fn text<I>(self: Self, text: I) -> Self where I: AsRef<str>Customize the text of the keep-alive message.
Default is an empty comment.
Panics
Panics if
textcontains any newline or carriage returns, as they are not allowed in SSE comments.fn event(self: Self, event: Event) -> SelfCustomize the event of the keep-alive message.
Default is an empty comment.
Panics
Panics if
eventcontains any newline or carriage returns, as they are not allowed in SSE comments.
impl Clone for KeepAlive
fn clone(self: &Self) -> KeepAlive
impl Debug for KeepAlive
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Default for KeepAlive
fn default() -> Self
impl Freeze for KeepAlive
impl RefUnwindSafe for KeepAlive
impl Send for KeepAlive
impl Sync for KeepAlive
impl Unpin for KeepAlive
impl UnwindSafe for KeepAlive
impl<T> Any for KeepAlive
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for KeepAlive
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for KeepAlive
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for KeepAlive
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for KeepAlive
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FromRef for KeepAlive
fn from_ref(input: &T) -> T
impl<T> Instrument for KeepAlive
impl<T> Same for KeepAlive
impl<T> ToOwned for KeepAlive
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> WithSubscriber for KeepAlive
impl<T, U> Into for KeepAlive
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for KeepAlive
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for KeepAlive
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<V, T> VZip for KeepAlive
fn vzip(self: Self) -> V