pub enum DispatchSource {
File(FileSource),
Http(HttpSource),
}
Expand description
A common source type, dispatching to the known implementations.
This helps to create implementations which don’t need to know the exact type. Unfortunately we
cannot just “box” this, as the Source
needs to implement Clone
, which requires Sized
,
which prevents us from using dyn
(“cannot be made into an object”).
There may be a better way around this, feel free to send a PR ;-)
Variants§
File(FileSource)
Http(HttpSource)
Trait Implementations§
Source§impl Clone for DispatchSource
impl Clone for DispatchSource
Source§fn clone(&self) -> DispatchSource
fn clone(&self) -> DispatchSource
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DispatchSource
impl Debug for DispatchSource
Source§impl From<FileSource> for DispatchSource
impl From<FileSource> for DispatchSource
Source§fn from(value: FileSource) -> Self
fn from(value: FileSource) -> Self
Converts to this type from the input type.
Source§impl From<HttpSource> for DispatchSource
impl From<HttpSource> for DispatchSource
Source§fn from(value: HttpSource) -> Self
fn from(value: HttpSource) -> Self
Converts to this type from the input type.
Source§impl KeySource for DispatchSource
impl KeySource for DispatchSource
Source§impl Source for DispatchSource
impl Source for DispatchSource
type Error = DispatchSourceError
type Retrieved = RetrievedAdvisory
Source§impl Source for DispatchSource
impl Source for DispatchSource
async fn load_metadata(&self) -> Result<ProviderMetadata, Self::Error>
async fn load_index( &self, context: DistributionContext, ) -> Result<Vec<DiscoveredAdvisory>, Self::Error>
async fn load_advisory( &self, advisory: DiscoveredAdvisory, ) -> Result<RetrievedAdvisory, Self::Error>
Auto Trait Implementations§
impl Freeze for DispatchSource
impl !RefUnwindSafe for DispatchSource
impl !Send for DispatchSource
impl !Sync for DispatchSource
impl Unpin for DispatchSource
impl !UnwindSafe for DispatchSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.