Struct debian_packaging::repository::proxy_writer::ProxyWriter
source · [−]pub struct ProxyWriter<W> { /* private fields */ }Expand description
A RepositoryWriter that proxies operations to an inner writer.
The behavior of each I/O operation can be configured to facilitate customizing behavior. It also records operations performed. This makes this type useful as part of testing and simulating what would occur.
Implementations
sourceimpl<W: RepositoryWriter + Send> ProxyWriter<W>
impl<W: RepositoryWriter + Send> ProxyWriter<W>
sourcepub fn new(writer: W) -> Self
pub fn new(writer: W) -> Self
Construct a new instance by wrapping an existing writer.
The default behavior for path verification is to call the inner writer.
sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Return the inner writer, consuming self.
sourcepub fn set_verify_behavior(&mut self, behavior: ProxyVerifyBehavior)
pub fn set_verify_behavior(&mut self, behavior: ProxyVerifyBehavior)
Set the behavior for RepositoryWriter::verify_path().
Trait Implementations
sourceimpl<W: RepositoryWriter + Send> RepositoryWriter for ProxyWriter<W>
impl<W: RepositoryWriter + Send> RepositoryWriter for ProxyWriter<W>
sourcefn verify_path<'path, 'life0, 'async_trait>(
&'life0 self,
path: &'path str,
expected_content: Option<(u64, ContentDigest)>
) -> Pin<Box<dyn Future<Output = Result<RepositoryPathVerification<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn verify_path<'path, 'life0, 'async_trait>(
&'life0 self,
path: &'path str,
expected_content: Option<(u64, ContentDigest)>
) -> Pin<Box<dyn Future<Output = Result<RepositoryPathVerification<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Verify the existence of a path with optional content integrity checking. Read more
sourcefn write_path<'path, 'reader, 'life0, 'async_trait>(
&'life0 self,
path: Cow<'path, str>,
reader: Pin<Box<dyn AsyncRead + Send + 'reader>>
) -> Pin<Box<dyn Future<Output = Result<RepositoryWrite<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'reader: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn write_path<'path, 'reader, 'life0, 'async_trait>(
&'life0 self,
path: Cow<'path, str>,
reader: Pin<Box<dyn AsyncRead + Send + 'reader>>
) -> Pin<Box<dyn Future<Output = Result<RepositoryWrite<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'reader: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Write data to a given path. Read more
sourcefn copy_from<'path, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
reader: &'life1 dyn RepositoryRootReader,
source_path: Cow<'path, str>,
expected_content: Option<(u64, ContentDigest)>,
dest_path: Cow<'path, str>,
progress_cb: &'life2 Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Pin<Box<dyn Future<Output = Result<RepositoryWriteOperation<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn copy_from<'path, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
reader: &'life1 dyn RepositoryRootReader,
source_path: Cow<'path, str>,
expected_content: Option<(u64, ContentDigest)>,
dest_path: Cow<'path, str>,
progress_cb: &'life2 Option<Box<dyn Fn(PublishEvent) + Sync>>
) -> Pin<Box<dyn Future<Output = Result<RepositoryWriteOperation<'path>>> + Send + 'async_trait>> where
'path: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Copy a path from a reader to this writer. Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for ProxyWriter<W> where
W: RefUnwindSafe,
impl<W> Send for ProxyWriter<W> where
W: Send,
impl<W> Sync for ProxyWriter<W> where
W: Sync,
impl<W> Unpin for ProxyWriter<W> where
W: Unpin,
impl<W> UnwindSafe for ProxyWriter<W> where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more