Skip to main content

ResolvedFile

Struct ResolvedFile 

Source
pub struct ResolvedFile { /* private fields */ }
Expand description

A resolved file capability created by the filesystem resolver.

This type cannot be constructed directly by external callers; it is only created through the resolver’s path confinement pipeline. A file capability produced by SecureRoot::resolve or resolve_and_plan.

All public construction paths verify that the file was opened through the path confinement pipeline. An internal-only constructor (from_parts, behind the python-bindings-internal feature) exists for cross-crate Python bindings where the file was already resolved through a secure path. This constructor does not re-verify provenance.

Implementations§

Source§

impl ResolvedFile

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn modified(&self) -> Option<SystemTime>

Source

pub fn content_type(&self) -> &'static str

Source

pub fn plan_response( &self, method: ReadOnlyMethod, if_none_match: Option<&str>, if_modified_since: Option<&str>, range_header: Option<&str>, if_range: Option<&str>, ) -> StaticResponsePlan

Plan a response using the metadata of this already-resolved file. This keeps directory-index resolution on the originating capability.

Source

pub fn safe_relative_components(&self) -> &[String]

Source

pub fn into_body( self, plan: &StaticResponsePlan, ) -> Result<BodySource, BodySourceError>

Source

pub fn into_range_body( self, start: u64, end_inclusive: u64, ) -> Result<BodySource, BodySourceError>

Trait Implementations§

Source§

impl Debug for ResolvedFile

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.