pub struct Hyperlink { /* private fields */ }Expand description
A terminal hyperlink attached to one run of text.
The URI and parameters remain logical data. The selected terminal output
boundary escapes and frames them when it encodes OSC 8. Parameter names and
values remain intentionally open-ended; terminals currently define id,
while future terminals may add more keys.
use urushi::{Hyperlink, TextStyle};
let plain = TextStyle::new().hyperlink("https://example.com");
let identified = TextStyle::new().hyperlink(
Hyperlink::new("https://example.com").parameter("id", "documentation"),
);
assert_eq!(plain.get_hyperlink().unwrap().uri(), "https://example.com");
assert_eq!(identified.get_hyperlink().unwrap().parameters().len(), 1);Implementations§
Trait Implementations§
impl Eq for Hyperlink
impl StructuralPartialEq for Hyperlink
Auto Trait Implementations§
impl Freeze for Hyperlink
impl RefUnwindSafe for Hyperlink
impl Send for Hyperlink
impl Sync for Hyperlink
impl Unpin for Hyperlink
impl UnsafeUnpin for Hyperlink
impl UnwindSafe for Hyperlink
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