Struct fiberplane_models::realtime::FocusPosition
source · #[non_exhaustive]pub struct FocusPosition {
pub cell_id: String,
pub field: Option<String>,
pub offset: Option<u32>,
}Expand description
A single focus position within a notebook.
Focus can be placed within a cell, and optionally within separate fields within the cell. An offset can be specified to indicate the exact position of the cursor within a text field.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cell_id: StringID of the focused cell.
May be the ID of an actual cell, or a so-called “surrogate ID”, such as the ID that indicates focus is on the title field.
field: Option<String>Key to identify which field inside a cell has focus.
May be None for cells that have only one (or no) text field.
E.g.: For time range cells, “to” or “from” could be used.
Note that fields do not necessarily have to be text fields. For example, we could also use this to indicate the user has focused a button for graph navigation.
offset: Option<u32>Offset within the text field.
May be None if the focus is not inside a text field.
Implementations§
Trait Implementations§
source§impl Clone for FocusPosition
impl Clone for FocusPosition
source§fn clone(&self) -> FocusPosition
fn clone(&self) -> FocusPosition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for FocusPosition
impl Debug for FocusPosition
source§impl<'de> Deserialize<'de> for FocusPosition
impl<'de> Deserialize<'de> for FocusPosition
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>,
source§impl PartialEq for FocusPosition
impl PartialEq for FocusPosition
source§fn eq(&self, other: &FocusPosition) -> bool
fn eq(&self, other: &FocusPosition) -> bool
self and other values to be equal, and is used
by ==.