pub struct FileRead;Expand description
Capability that reads the contents of a file.
Opens file with O_NOFOLLOW to prevent TOCTOU symlink escape, uses bounded reader regardless of metadata to prevent size bypass, detects binary content, and handles UTF-8 boundary splits.
Trait Implementations§
Source§impl TypedCapability for FileRead
impl TypedCapability for FileRead
Source§type Args = FileReadArgs
type Args = FileReadArgs
The typed arguments struct for this capability. Read more
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Returns a one-line description of what this capability does.
Source§fn execute(
&self,
args: FileReadArgs,
_ctx: &Context,
) -> Result<Output, CapabilityError>
fn execute( &self, args: FileReadArgs, _ctx: &Context, ) -> Result<Output, CapabilityError>
Executes the capability with typed arguments. Read more
Auto Trait Implementations§
impl Freeze for FileRead
impl RefUnwindSafe for FileRead
impl Send for FileRead
impl Sync for FileRead
impl Unpin for FileRead
impl UnsafeUnpin for FileRead
impl UnwindSafe for FileRead
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