#[non_exhaustive]pub struct StoreVisitor {
pub base: PathBuf,
pub no_timestamps: bool,
pub no_xattrs: bool,
pub allowed_client_errors: HashSet<StatusCode>,
}Expand description
Stores all data so that it can be used as a crate::source::Source later.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base: PathBufthe output base
no_timestamps: boolwhether to set the file modification timestamps
no_xattrs: boolwhether to store additional metadata (like the etag) using extended attributes
allowed_client_errors: HashSet<StatusCode>the clients errors which can be ignored
Implementations§
Source§impl StoreVisitor
impl StoreVisitor
pub fn new(base: impl Into<PathBuf>) -> Self
pub fn no_timestamps(self, no_timestamps: bool) -> Self
pub fn no_xattrs(self, no_xattrs: bool) -> Self
pub fn allow_client_errors( self, allowed_client_errors: HashSet<StatusCode>, ) -> Self
Sourcepub fn allow_client_errors_iter(
self,
allowed_client_errors: impl IntoIterator<Item = StatusCode>,
) -> Self
pub fn allow_client_errors_iter( self, allowed_client_errors: impl IntoIterator<Item = StatusCode>, ) -> Self
Similar to Self::allow_client_errors, but accepting any iterable and removing duplicates
in the process.
Trait Implementations§
Source§impl<S: Source + Debug> RetrievedVisitor<S> for StoreVisitorwhere
S::Error: 'static,
impl<S: Source + Debug> RetrievedVisitor<S> for StoreVisitorwhere
S::Error: 'static,
Source§async fn visit_advisory(
&self,
_context: &Self::Context,
result: Result<RetrievedAdvisory, RetrievalError<DiscoveredAdvisory, S>>,
) -> Result<(), Self::Error>
async fn visit_advisory( &self, _context: &Self::Context, result: Result<RetrievedAdvisory, RetrievalError<DiscoveredAdvisory, S>>, ) -> Result<(), Self::Error>
Stores a retrieved advisory or its retrieval error. Fails if storing fails.
type Error = StoreRetrievedError<S>
type Context = Rc<ProviderMetadata>
async fn visit_context( &self, context: &RetrievalContext<'_>, ) -> Result<Self::Context, Self::Error>
Source§impl<S: Source> ValidatedVisitor<S> for StoreVisitor
impl<S: Source> ValidatedVisitor<S> for StoreVisitor
type Error = StoreValidatedError<S>
type Context = ()
async fn visit_context( &self, context: &ValidationContext<'_>, ) -> Result<Self::Context, Self::Error>
async fn visit_advisory( &self, _context: &Self::Context, result: Result<ValidatedAdvisory, ValidationError<S>>, ) -> Result<(), Self::Error>
Auto Trait Implementations§
impl Freeze for StoreVisitor
impl RefUnwindSafe for StoreVisitor
impl Send for StoreVisitor
impl Sync for StoreVisitor
impl Unpin for StoreVisitor
impl UnwindSafe for StoreVisitor
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