Struct grep_printer::HyperlinkEnvironment
source · pub struct HyperlinkEnvironment { /* private fields */ }
Expand description
A static environment for hyperlink interpolation.
This environment permits setting the values of variables used in hyperlink interpolation that are not expected to change for the lifetime of a program. That is, these values are invariant.
Currently, this includes the hostname and a WSL distro prefix.
Implementations§
source§impl HyperlinkEnvironment
impl HyperlinkEnvironment
sourcepub fn new() -> HyperlinkEnvironment
pub fn new() -> HyperlinkEnvironment
Create a new empty hyperlink environment.
sourcepub fn host(&mut self, host: Option<String>) -> &mut HyperlinkEnvironment
pub fn host(&mut self, host: Option<String>) -> &mut HyperlinkEnvironment
Set the {host}
variable, which fills in any hostname components of
a hyperlink.
One can get the hostname in the current environment via the hostname
function in the grep-cli
crate.
sourcepub fn wsl_prefix(
&mut self,
wsl_prefix: Option<String>
) -> &mut HyperlinkEnvironment
pub fn wsl_prefix( &mut self, wsl_prefix: Option<String> ) -> &mut HyperlinkEnvironment
Set the {wslprefix}
variable, which contains the WSL distro prefix.
An example value is wsl$/Ubuntu
. The distro name can typically be
discovered from the WSL_DISTRO_NAME
environment variable.
Trait Implementations§
source§impl Clone for HyperlinkEnvironment
impl Clone for HyperlinkEnvironment
source§fn clone(&self) -> HyperlinkEnvironment
fn clone(&self) -> HyperlinkEnvironment
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 HyperlinkEnvironment
impl Debug for HyperlinkEnvironment
source§impl Default for HyperlinkEnvironment
impl Default for HyperlinkEnvironment
source§fn default() -> HyperlinkEnvironment
fn default() -> HyperlinkEnvironment
Returns the “default value” for a type. Read more
source§impl PartialEq<HyperlinkEnvironment> for HyperlinkEnvironment
impl PartialEq<HyperlinkEnvironment> for HyperlinkEnvironment
source§fn eq(&self, other: &HyperlinkEnvironment) -> bool
fn eq(&self, other: &HyperlinkEnvironment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HyperlinkEnvironment
impl StructuralEq for HyperlinkEnvironment
impl StructuralPartialEq for HyperlinkEnvironment
Auto Trait Implementations§
impl RefUnwindSafe for HyperlinkEnvironment
impl Send for HyperlinkEnvironment
impl Sync for HyperlinkEnvironment
impl Unpin for HyperlinkEnvironment
impl UnwindSafe for HyperlinkEnvironment
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