pub enum Source {
Url(Url),
String(String),
}
Available on crate feature
registry
only.Expand description
The input source. Can be a URL or any generic string.
Variants§
Implementations§
Source§impl Source
impl Source
Sourcepub fn try_into_url(self) -> Option<Url>
pub fn try_into_url(self) -> Option<Url>
Extracts the inner Url from this source if available.
Sourcepub fn into_url(self) -> Url
pub fn into_url(self) -> Url
Extracts the inner Url from this source, panicking if not available.
§Panics
If the type is not Source::Url
.
Sourcepub fn try_into_string(self) -> Option<String>
pub fn try_into_string(self) -> Option<String>
Extracts the inner String from this source if available.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Extracts the inner String from this source, panicking if not available.
§Panics
If the type is not Source::String
.
Trait Implementations§
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.