pub struct Link {
pub url: String,
pub params: String,
}Expand description
A shared OSC 8 hyperlink target for a Cell.
A link is used when styled text should also open a terminal hyperlink.
Cells store links behind an Arc so many cells in
the same hyperlink span can share one allocation. The URL and parameter
string are emitted verbatim as OSC 8 ; params ; url ST; callers are
responsible for passing values that are appropriate for the target
terminal.
Fields§
§url: StringTarget URI written into the OSC 8 sequence.
An empty URL clears the link through Cell::set_link.
params: StringOSC 8 parameter string written between the two semicolons.
Use an empty string for no parameters, or terminal-supported
key=value pairs such as id=section.
Trait Implementations§
Source§impl Display for Link
Render this link as OSC 8 escape sequences.
impl Display for Link
Render this link as OSC 8 escape sequences.
The default form ({link}) writes the parameters and URL verbatim.
An empty URL closes the current hyperlink.
The alternate form ({link:#}) closes the current hyperlink with empty
parameters and URL. It preserves the visual style and clears the link
rather than restoring a previous one.
use uncurses::style::Link;
let link = Link {
url: "https://example.com".into(),
params: String::new(),
};
println!("{link}Example{link:#}");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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more