pub enum AutoSleep {
Automatic,
NotBefore(Duration),
Never,
}Expand description
When Sail may put a Sailbox to sleep on its own.
Sail watches for Sailboxes that are doing nothing and sleeps them, freeing their memory and waking them the moment anything needs them again. Waking takes a couple of seconds, which is free for a batch job and unwelcome if someone is waiting at a terminal.
Every choice here can only make Sail sleep the Sailbox less often than it otherwise would. None of them can cause a sleep, and Sail still sleeps a Sailbox only when it sits fully idle: no busy process, no imminent timer, nothing a sleep would interrupt.
Calling sleep yourself is unaffected, and
so are pause, resume, and scheduled wakes.
Variants§
Automatic
Sail decides, on its own timing. The default.
NotBefore(Duration)
Sail decides, but waits at least this long first. A duration shorter
than Sail’s own wait is accepted and simply has no effect; anything
longer holds the Sailbox awake for that much idle time. A wait longer
than an hour is rejected; use Never instead.
Never
Sail never sleeps this Sailbox on its own.
Trait Implementations§
impl Copy for AutoSleep
Source§impl<'de> Deserialize<'de> for AutoSleep
impl<'de> Deserialize<'de> for AutoSleep
Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<AutoSleep, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<AutoSleep, D::Error>
impl Eq for AutoSleep
impl StructuralPartialEq for AutoSleep
Auto Trait Implementations§
impl Freeze for AutoSleep
impl RefUnwindSafe for AutoSleep
impl Send for AutoSleep
impl Sync for AutoSleep
impl Unpin for AutoSleep
impl UnsafeUnpin for AutoSleep
impl UnwindSafe for AutoSleep
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request