Struct grep_printer::HyperlinkFormat
source · pub struct HyperlinkFormat { /* private fields */ }
Expand description
A hyperlink format with variables.
This can be created by parsing a string using HyperlinkFormat::from_str
.
The default format is empty. An empty format is valid and effectively disables hyperlinks.
Example
use grep_printer::HyperlinkFormat;
let fmt = "vscode".parse::<HyperlinkFormat>()?;
assert_eq!(fmt.to_string(), "vscode://file{path}:{line}:{column}");
Implementations§
source§impl HyperlinkFormat
impl HyperlinkFormat
sourcepub fn empty() -> HyperlinkFormat
pub fn empty() -> HyperlinkFormat
Creates an empty hyperlink format.
sourcepub fn into_config(self, env: HyperlinkEnvironment) -> HyperlinkConfig
pub fn into_config(self, env: HyperlinkEnvironment) -> HyperlinkConfig
Creates a HyperlinkConfig
from this format and the environment
given.
Trait Implementations§
source§impl Clone for HyperlinkFormat
impl Clone for HyperlinkFormat
source§fn clone(&self) -> HyperlinkFormat
fn clone(&self) -> HyperlinkFormat
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 HyperlinkFormat
impl Debug for HyperlinkFormat
source§impl Default for HyperlinkFormat
impl Default for HyperlinkFormat
source§fn default() -> HyperlinkFormat
fn default() -> HyperlinkFormat
Returns the “default value” for a type. Read more
source§impl Display for HyperlinkFormat
impl Display for HyperlinkFormat
source§impl FromStr for HyperlinkFormat
impl FromStr for HyperlinkFormat
§type Err = HyperlinkFormatError
type Err = HyperlinkFormatError
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<HyperlinkFormat, HyperlinkFormatError>
fn from_str(s: &str) -> Result<HyperlinkFormat, HyperlinkFormatError>
Parses a string
s
to return a value of this type. Read moresource§impl PartialEq<HyperlinkFormat> for HyperlinkFormat
impl PartialEq<HyperlinkFormat> for HyperlinkFormat
source§fn eq(&self, other: &HyperlinkFormat) -> bool
fn eq(&self, other: &HyperlinkFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HyperlinkFormat
impl StructuralEq for HyperlinkFormat
impl StructuralPartialEq for HyperlinkFormat
Auto Trait Implementations§
impl RefUnwindSafe for HyperlinkFormat
impl Send for HyperlinkFormat
impl Sync for HyperlinkFormat
impl Unpin for HyperlinkFormat
impl UnwindSafe for HyperlinkFormat
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