pub struct ResourceLimits { /* private fields */ }Expand description
Default resource policy for a client. Per-call options override it. Byte limits bound logical payload, not allocator capacity or RPC overhead.
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
pub fn new() -> ResourceLimits
Sourcepub const fn with_max_read_bytes(self, value: usize) -> ResourceLimits
pub const fn with_max_read_bytes(self, value: usize) -> ResourceLimits
Set the collected read budget; zero permits only empty payloads.
Sourcepub const fn max_read_bytes(self) -> usize
pub const fn max_read_bytes(self) -> usize
Read the configured policy value.
Sourcepub const fn with_stream_chunk_size(
self,
value: NonZero<usize>,
) -> ResourceLimits
pub const fn with_stream_chunk_size( self, value: NonZero<usize>, ) -> ResourceLimits
Set the default streaming chunk size. Nonzero chunks guarantee progress.
Sourcepub const fn stream_chunk_size(self) -> usize
pub const fn stream_chunk_size(self) -> usize
Read the configured policy value.
Sourcepub const fn with_max_directory_entries(self, value: usize) -> ResourceLimits
pub const fn with_max_directory_entries(self, value: usize) -> ResourceLimits
Set the aggregate directory entry budget; zero is a valid budget.
Sourcepub const fn max_directory_entries(self) -> usize
pub const fn max_directory_entries(self) -> usize
Read the configured policy value.
Sourcepub const fn with_max_directory_path_bytes(self, value: usize) -> ResourceLimits
pub const fn with_max_directory_path_bytes(self, value: usize) -> ResourceLimits
Set the aggregate path byte budget; zero is a valid budget.
Sourcepub const fn max_directory_path_bytes(self) -> usize
pub const fn max_directory_path_bytes(self) -> usize
Read the configured policy value.
Sourcepub const fn with_max_walk_depth(self, value: DepthLimit) -> ResourceLimits
pub const fn with_max_walk_depth(self, value: DepthLimit) -> ResourceLimits
Set maximum descent depth; zero includes only the starting directory.
Sourcepub const fn max_walk_depth(self) -> DepthLimit
pub const fn max_walk_depth(self) -> DepthLimit
Read the configured policy value.
pub fn directory_options(self) -> ListDirOptions
pub fn walk_options(self) -> ListDirOptions
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResourceLimits
Source§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Source§impl Default for ResourceLimits
impl Default for ResourceLimits
Source§fn default() -> ResourceLimits
fn default() -> ResourceLimits
Returns the “default value” for a type. Read more
impl Eq for ResourceLimits
Source§impl PartialEq for ResourceLimits
impl PartialEq for ResourceLimits
impl StructuralPartialEq for ResourceLimits
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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