pub struct Link {
pub name: String,
pub keyword: String,
pub template: String,
}Expand description
A named URL template. {query} is replaced with the percent-encoded query.
Fields§
§name: StringDisplay name — “YouTube”, “Wikipedia”.
keyword: StringWord that claims the query. Empty for fallbacks, which are not addressed but appended.
template: StringURL with an optional {query} placeholder.
Implementations§
Source§impl Link
impl Link
Sourcepub fn match_query<'a>(&self, query: &'a str) -> Option<&'a str>
pub fn match_query<'a>(&self, query: &'a str) -> Option<&'a str>
Whether this link’s keyword claims query, and the text after it.
Same word-boundary rule as plugin keywords: the keyword must be
followed by a space or end the query, so youtube is not read as a
yt quicklink plus outube.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin for Link
impl UnwindSafe for Link
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