pub struct Point {
pub x: Option<f64>,
pub y: Option<f64>,
pub at: Option<String>,
pub query: Option<String>,
pub display_id: DisplayId,
pub label: Option<String>,
pub ttl_ms: Option<u64>,
}Expand description
Put the orb on a target.
Two forms. Clients that ground coordinates themselves send x and y. Clients that
cannot send query instead, which needs a configured resolver.
Fields§
§x: Option<f64>Horizontal position in logical points. Paired with y.
y: Option<f64>Vertical position in logical points. Paired with x.
at: Option<String>A position named relative to the display, such as top-left or 50%,30%.
For clients that have not measured the screen and so cannot name a coordinate. Resolved by the daemon, which is the only party that knows the geometry.
query: Option<String>Natural language description of the target, resolved by the daemon.
display_id: DisplayIdThe display the coordinates, position, or query apply to.
label: Option<String>Short caption rendered next to the orb.
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 Point
impl Point
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 named(at: impl Into<String>, display_id: DisplayId) -> Self
pub fn named(at: impl Into<String>, display_id: DisplayId) -> Self
At a position named relative to the display, such as top-left or 50%,30%.
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<PointTarget<'_>, ValidationError>
pub fn target(&self) -> Result<PointTarget<'_>, ValidationError>
Which form was sent.
Exactly one of the three. Half a coordinate pair, or two forms at once, is an error rather than a guess: every one of those is a client bug, and drawing somewhere plausible would hide it.