Struct debian_packaging::io::PathMappingDataResolver
source · pub struct PathMappingDataResolver<R> { /* private fields */ }Expand description
A DataResolver that maintains a path translation table and transparently redirects lookups.
Implementations§
source§impl<R: DataResolver + Send> PathMappingDataResolver<R>
impl<R: DataResolver + Send> PathMappingDataResolver<R>
sourcepub fn new(source: R) -> Self
pub fn new(source: R) -> Self
Construct a new instance that forwards to a source DataResolver.
sourcepub fn add_path_map(&mut self, from_path: impl ToString, to_path: impl ToString)
pub fn add_path_map(&mut self, from_path: impl ToString, to_path: impl ToString)
Register a mapping of 1 path to another.
Future looks up from_path will resolve to to_path.
Trait Implementations§
source§impl<R: DataResolver + Send> DataResolver for PathMappingDataResolver<R>
impl<R: DataResolver + Send> DataResolver for PathMappingDataResolver<R>
source§fn get_path<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_path<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the content of a relative path as an async reader. Read more
source§fn get_path_with_digest_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected_size: u64,
expected_digest: ContentDigest
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_path_with_digest_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected_size: u64,
expected_digest: ContentDigest
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Obtain a reader that performs content integrity checking. Read more
source§fn get_path_decoded<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
compression: Compression
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_path_decoded<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
compression: Compression
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the content of a relative path with decompression transparently applied.
source§fn get_path_decoded_with_digest_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
compression: Compression,
expected_size: u64,
expected_digest: ContentDigest
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_path_decoded_with_digest_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
compression: Compression,
expected_size: u64,
expected_digest: ContentDigest
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Self::get_path_decoded() but also perform content integrity verification. Read more
Auto Trait Implementations§
impl<R> RefUnwindSafe for PathMappingDataResolver<R>where
R: RefUnwindSafe,
impl<R> Send for PathMappingDataResolver<R>where
R: Send,
impl<R> Sync for PathMappingDataResolver<R>where
R: Sync,
impl<R> Unpin for PathMappingDataResolver<R>where
R: Unpin,
impl<R> UnwindSafe for PathMappingDataResolver<R>where
R: UnwindSafe,
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