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
impl ResolvedFile
pub fn len(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn modified(&self) -> Option<SystemTime>
pub fn content_type(&self) -> &'static str
Sourcepub 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
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.
pub fn safe_relative_components(&self) -> &[String]
pub fn into_body( self, plan: &StaticResponsePlan, ) -> Result<BodySource, BodySourceError>
pub fn into_range_body( self, start: u64, end_inclusive: u64, ) -> Result<BodySource, BodySourceError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResolvedFile
impl RefUnwindSafe for ResolvedFile
impl Send for ResolvedFile
impl Sync for ResolvedFile
impl Unpin for ResolvedFile
impl UnsafeUnpin for ResolvedFile
impl UnwindSafe for ResolvedFile
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