pub struct Target { /* private fields */ }Expand description
A parsed target.
Implementations§
Source§impl Target
impl Target
Sourcepub fn parse(text: &str) -> Result<Target, Reason>
pub fn parse(text: &str) -> Result<Target, Reason>
Parses a URL, or an absolute local path (/home/a.png,
C:\a.png, \\server\share\a.png) made a file: URL.
pub fn url(&self) -> &Url
Sourcepub fn host_ascii(&self) -> Option<&str>
pub fn host_ascii(&self) -> Option<&str>
The host as the address carries it (punycode for an internationalised one).
Sourcepub fn is_idn(&self) -> bool
pub fn is_idn(&self) -> bool
Whether the host is internationalised: its Unicode form and its punycode differ, and both are shown.
Sourcepub fn host_shown(&self) -> Option<String>
pub fn host_shown(&self) -> Option<String>
The host as shown to the user: Unicode, with its punycode beside
it when they differ (bücher.example (xn--bcher-kva.example)).
Sourcepub fn youtube_id(&self) -> Option<String>
pub fn youtube_id(&self) -> Option<String>
The video of a YouTube link, when it names one: watch?v=<id>,
youtu.be/<id>, embed/<id>, shorts/<id> and live/<id> on
youtube.com, youtube-nocookie.com and their subdomains, over
https: only. The id is YouTube’s eleven letters, digits, - and
_; anything else names no video.
Sourcepub fn local_path(&self) -> Option<String>
pub fn local_path(&self) -> Option<String>
The local path of a file: target.
Sourcepub fn shown(&self) -> String
pub fn shown(&self) -> String
The text to show for it: the path when one was given, else the URL.
Sourcepub fn looks_executable(&self) -> bool
pub fn looks_executable(&self) -> bool
Whether its extension is a program’s or a script’s.
Trait Implementations§
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more