pub struct Textbox {
pub anchor: Option<Anchor>,
pub rect: Option<LogicalRect>,
pub display_id: Option<DisplayId>,
pub text: String,
pub ttl_ms: Option<u64>,
}Expand description
Place a text box.
Display only. Arin never renders an editable input, and the overlay is fully click through. This is not negotiable within 0.x.
Fields§
§anchor: Option<Anchor>Where to pin the box. Preferred form.
rect: Option<LogicalRect>Shorthand for an anchor, used with display_id.
display_id: Option<DisplayId>Required when rect is used instead of anchor.
text: StringThe text to render.
ttl_ms: Option<u64>How long the box should live, in milliseconds.
Omit to draw until cleared, invalidated, or the session ends.
Implementations§
Source§impl Textbox
impl Textbox
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 box lives, in milliseconds.
Sourcepub fn resolved_anchor(&self) -> Result<Anchor, ValidationError>
pub fn resolved_anchor(&self) -> Result<Anchor, ValidationError>
The anchor, whichever form was sent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Textbox
impl<'de> Deserialize<'de> for Textbox
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 Textbox
Auto Trait Implementations§
impl Freeze for Textbox
impl RefUnwindSafe for Textbox
impl Send for Textbox
impl Sync for Textbox
impl Unpin for Textbox
impl UnsafeUnpin for Textbox
impl UnwindSafe for Textbox
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