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 for HyperlinkEnvironment
impl PartialEq for HyperlinkEnvironment
impl Eq for HyperlinkEnvironment
impl StructuralPartialEq for HyperlinkEnvironment
Auto Trait Implementations§
impl Freeze for HyperlinkEnvironment
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)