pub struct ResourceAccountant { /* private fields */ }Implementations§
Source§impl ResourceAccountant
impl ResourceAccountant
pub fn new(limits: ResourceLimits) -> Self
pub fn limits(&self) -> &ResourceLimits
pub fn snapshot( &self, processes: &ProcessTable, fd_tables: &FdTableManager, pipes: &PipeManager, ptys: &PtyManager, sockets: &SocketTable, ) -> ResourceSnapshot
pub fn check_process_spawn( &self, snapshot: &ResourceSnapshot, additional_fds: usize, ) -> Result<(), ResourceError>
pub fn check_process_argv_bytes( &self, command: &str, args: &[String], ) -> Result<(), ResourceError>
pub fn check_process_env_bytes( &self, inherited_env: &BTreeMap<String, String>, overrides: &BTreeMap<String, String>, ) -> Result<(), ResourceError>
pub fn check_pipe_allocation( &self, snapshot: &ResourceSnapshot, ) -> Result<(), ResourceError>
pub fn check_pty_allocation( &self, snapshot: &ResourceSnapshot, ) -> Result<(), ResourceError>
pub fn check_socket_allocation( &self, snapshot: &ResourceSnapshot, ) -> Result<(), ResourceError>
pub fn check_socket_state_transition( &self, snapshot: &ResourceSnapshot, current: SocketState, next: SocketState, ) -> Result<(), ResourceError>
pub fn check_socket_buffer_growth( &self, snapshot: &ResourceSnapshot, additional_bytes: usize, ) -> Result<(), ResourceError>
pub fn check_socket_datagram_enqueue( &self, snapshot: &ResourceSnapshot, additional_bytes: usize, ) -> Result<(), ResourceError>
pub fn check_pread_length(&self, length: usize) -> Result<(), ResourceError>
pub fn check_fd_write_size(&self, size: usize) -> Result<(), ResourceError>
pub fn check_fd_allocation( &self, snapshot: &ResourceSnapshot, additional_fds: usize, ) -> Result<(), ResourceError>
pub fn max_readdir_entries(&self) -> Option<usize>
pub fn check_readdir_entries(&self, entries: usize) -> Result<(), ResourceError>
pub fn check_filesystem_usage( &self, _usage: &FileSystemUsage, resulting_bytes: u64, resulting_inodes: usize, ) -> Result<(), ResourceError>
Auto Trait Implementations§
impl Freeze for ResourceAccountant
impl RefUnwindSafe for ResourceAccountant
impl Send for ResourceAccountant
impl Sync for ResourceAccountant
impl Unpin for ResourceAccountant
impl UnsafeUnpin for ResourceAccountant
impl UnwindSafe for ResourceAccountant
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more