Skip to main content

PathCodec

Trait PathCodec 

Source
pub trait PathCodec:
    Send
    + Sync
    + 'static {
    // Required methods
    fn encode(&self, real: &str) -> String;
    fn decode(&self, shadow: &str) -> Result<String, PathCodecError>;
}
Expand description

Converts between real storage paths and client-visible shadow paths.

encode is total: every real path must be representable (an encrypting codec can always encrypt; a mapping codec falls back to identity for unmapped subtrees so listings never fail). decode fails when the shadow is invalid, tampered with, or unmapped — the caller turns that into a 400.

Required Methods§

Source

fn encode(&self, real: &str) -> String

Real path → shadow path.

Source

fn decode(&self, shadow: &str) -> Result<String, PathCodecError>

Shadow path → real path.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§