#[non_exhaustive]pub struct BasicScaling {
pub idle_timeout: Option<Duration>,
pub max_instances: i32,
/* private fields */
}
Expand description
A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.idle_timeout: Option<Duration>
Duration of time after the last request that an instance must wait before the instance is shut down.
max_instances: i32
Maximum number of instances to create for this version.
Implementations§
Source§impl BasicScaling
impl BasicScaling
pub fn new() -> Self
Sourcepub fn set_idle_timeout<T>(self, v: T) -> Self
pub fn set_idle_timeout<T>(self, v: T) -> Self
Sets the value of idle_timeout.
Sourcepub fn set_or_clear_idle_timeout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_idle_timeout<T>(self, v: Option<T>) -> Self
Sets or clears the value of idle_timeout.
Sourcepub fn set_max_instances<T: Into<i32>>(self, v: T) -> Self
pub fn set_max_instances<T: Into<i32>>(self, v: T) -> Self
Sets the value of max_instances.
Trait Implementations§
Source§impl Clone for BasicScaling
impl Clone for BasicScaling
Source§fn clone(&self) -> BasicScaling
fn clone(&self) -> BasicScaling
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BasicScaling
impl Debug for BasicScaling
Source§impl Default for BasicScaling
impl Default for BasicScaling
Source§fn default() -> BasicScaling
fn default() -> BasicScaling
Returns the “default value” for a type. Read more
Source§impl Message for BasicScaling
impl Message for BasicScaling
Source§impl PartialEq for BasicScaling
impl PartialEq for BasicScaling
impl StructuralPartialEq for BasicScaling
Auto Trait Implementations§
impl Freeze for BasicScaling
impl RefUnwindSafe for BasicScaling
impl Send for BasicScaling
impl Sync for BasicScaling
impl Unpin for BasicScaling
impl UnwindSafe for BasicScaling
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