pub struct Highlight {
pub rect: Option<LogicalRect>,
pub query: Option<String>,
pub display_id: DisplayId,
pub label: Option<String>,
pub ttl_ms: Option<u64>,
}Expand description
Outline a region.
Fields§
§rect: Option<LogicalRect>The region in logical points, as [x, y, width, height].
query: Option<String>Natural language description of the region, resolved by the daemon.
display_id: DisplayIdThe display the rect or query applies to.
label: Option<String>Short caption rendered against the region.
ttl_ms: Option<u64>How long the mark should live, in milliseconds.
Omit to draw until cleared, invalidated, or the session ends.
Implementations§
Source§impl Highlight
impl Highlight
Sourcepub const fn over(rect: LogicalRect, display_id: DisplayId) -> Self
pub const fn over(rect: LogicalRect, display_id: DisplayId) -> Self
Over an explicit rect.
Sourcepub fn query(query: impl Into<String>, display_id: DisplayId) -> Self
pub fn query(query: impl Into<String>, display_id: DisplayId) -> Self
From a natural language description. Requires a resolver.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Attach a caption.
Sourcepub fn with_ttl_ms(self, ttl_ms: Option<u64>) -> Self
pub fn with_ttl_ms(self, ttl_ms: Option<u64>) -> Self
Set how long the mark lives, in milliseconds.
Sourcepub fn target(&self) -> Result<HighlightTarget<'_>, ValidationError>
pub fn target(&self) -> Result<HighlightTarget<'_>, ValidationError>
Which form was sent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Highlight
impl<'de> Deserialize<'de> for Highlight
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Highlight
Auto Trait Implementations§
impl Freeze for Highlight
impl RefUnwindSafe for Highlight
impl Send for Highlight
impl Sync for Highlight
impl Unpin for Highlight
impl UnsafeUnpin for Highlight
impl UnwindSafe for Highlight
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