Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
    pub max_connections: usize,
    pub max_registrations: usize,
    pub max_service_watches_per_connection: usize,
    pub max_parallel_operations: usize,
    pub max_watch_streams: usize,
    pub max_instances_per_service: usize,
    pub max_total_instances: usize,
    pub max_snapshot_bytes: usize,
    pub max_transport_tasks: usize,
}
Expand description

owner 共享的资源上限;超出容量时拒绝新增工作。

Fields§

§max_connections: usize

同时保留的连接数量上限。

§max_registrations: usize

owner 可持有的注册目标数量上限。

§max_service_watches_per_connection: usize

每个连接可同时观察的服务数量上限。

§max_parallel_operations: usize

owner 后端操作的并发上限。

§max_watch_streams: usize

owner 同时持有的后端 watch 流数量上限。

§max_instances_per_service: usize

单个服务快照允许包含的实例数量上限。

§max_total_instances: usize

owner 所有保留快照的实例总数上限。

§max_snapshot_bytes: usize

owner 所有保留快照的估算字节总数上限。

§max_transport_tasks: usize

连接驱动与正文等传输任务的共享容量上限。

Implementations§

Source§

impl Limits

Source

pub fn validate(&self) -> Result<()>

业务作用:拒绝无法执行或可能溢出的容量设置。

参数说明:无。

返回:合法容量可构造资源池;零容量和异常大容量返回配置错误。

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Limits

Source§

fn default() -> Self

业务作用:为连接、后台工作与被持有的快照设置有限容量。

参数说明:无。

返回:所有限制均为正值的默认容量。

Source§

impl<'de> Deserialize<'de> for Limits
where Limits: Default,

Source§

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 Serialize for Limits

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Forget for Limits

§

impl Freeze for Limits

§

impl Move for Limits

§

impl RefUnwindSafe for Limits

§

impl Send for Limits

§

impl Sync for Limits

§

impl Unpin for Limits

§

impl UnsafeUnpin for Limits

§

impl UnwindSafe for Limits

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.