#[non_exhaustive]pub enum NotebookFocus {
None,
Collapsed(FocusPosition),
Selection {
anchor: FocusPosition,
focus: FocusPosition,
},
}Expand description
Specifies the user’s focus and optional selection within the notebook.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
The user has no focus within the notebook.
Collapsed(FocusPosition)
The user focus is within the notebook and the focus is on a single position. I.e. there is no selection.
Selection
The user has a selection within the notebook that started at the given anchor position and ends at the given focus position.
Implementations§
Source§impl NotebookFocus
impl NotebookFocus
pub fn anchor_cell_id(&self) -> Option<&str>
pub fn anchor_cell_index(&self, cell_ids: &[&str]) -> Option<usize>
pub fn anchor_field(&self) -> Option<&str>
pub fn anchor_offset(&self) -> u32
pub fn anchor_position(&self) -> Option<&FocusPosition>
pub fn end_cell_id(&self, cell_ids: &[&str]) -> Option<&str>
pub fn end_offset(&self, cell_ids: &[&str]) -> u32
pub fn focus_cell_id(&self) -> Option<&str>
pub fn focus_cell_index(&self, cell_ids: &[&str]) -> Option<usize>
pub fn focus_field(&self) -> Option<&str>
pub fn focus_offset(&self) -> u32
pub fn focus_position(&self) -> Option<&FocusPosition>
pub fn has_selection(&self) -> bool
Sourcepub fn is_collapsed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Returns whether the cursor position is collapsed, ie. the opposite of
has_selection().
pub fn is_none(&self) -> bool
pub fn start_cell_id(&self, cell_ids: &[&str]) -> Option<&str>
pub fn start_offset(&self, cell_ids: &[&str]) -> u32
Trait Implementations§
Source§impl Clone for NotebookFocus
impl Clone for NotebookFocus
Source§fn clone(&self) -> NotebookFocus
fn clone(&self) -> NotebookFocus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NotebookFocus
impl Debug for NotebookFocus
Source§impl Default for NotebookFocus
impl Default for NotebookFocus
Source§fn default() -> NotebookFocus
fn default() -> NotebookFocus
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NotebookFocus
impl<'de> Deserialize<'de> for NotebookFocus
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 Eq for NotebookFocus
Source§impl PartialEq for NotebookFocus
impl PartialEq for NotebookFocus
Source§impl Serialize for NotebookFocus
impl Serialize for NotebookFocus
impl StructuralPartialEq for NotebookFocus
Auto Trait Implementations§
impl Freeze for NotebookFocus
impl RefUnwindSafe for NotebookFocus
impl Send for NotebookFocus
impl Sync for NotebookFocus
impl Unpin for NotebookFocus
impl UnsafeUnpin for NotebookFocus
impl UnwindSafe for NotebookFocus
Blanket Implementations§
impl<T> BindgenSerializable for T
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