Struct Options

Source
pub struct Options {
Show 20 fields pub selection_mode: SelectionMode, pub use_virtual_edit: bool, pub use_paging_optimization: bool, pub show_line_numbers: bool, pub show_status_line: bool, pub show_cursor: bool, pub use_spans: bool, pub use_for_ssg: bool, pub use_background: bool, pub theme_name: Option<String>, pub syntax_token: String, pub occupy_container: bool, pub page_size: usize, pub use_syntax_highlighter: bool, pub use_smart_replace_insert: bool, pub allow_text_selection: bool, pub scroll_cursor_into_view: bool, pub enable_context_menu: bool, pub enable_keypresses: bool, pub enable_click: bool,
}

Fields§

§selection_mode: SelectionMode

block selection uses rectangular text selection linear selection select lines as most text editors

§use_virtual_edit: bool

allow the click outside of the bounds of the text content editor

§use_paging_optimization: bool

allow the editor to show or hide pages for optimization Note: set this to false when using the editor as a headless buffer

§show_line_numbers: bool

show line numbers

§show_status_line: bool

show the status line

§show_cursor: bool

show virtual cursor

§use_spans: bool

use spans instead of div when rendering ranges and characters this is used when doing a static site rendering

§use_for_ssg: bool

when used for ssg, whitespace will be rendered as  

§use_background: bool

apply background on the characters from syntax highlighter

§theme_name: Option<String>

The syntect theme name used for syntax highlighting

§syntax_token: String

the syntax token used for text highlighting, usually the PL name ie: rust, typescript, sql

§occupy_container: bool

whether or not the editor occupy the container element false means the editor only expands to the number of lines in the code

§page_size: usize

number of lines in a page, when paging up and down

§use_syntax_highlighter: bool

a flag to use syntax highlighting or not

§use_smart_replace_insert: bool

a flag to do replace mode when there is no characters to the right and switch to insert mode when there is characters to the right

§allow_text_selection: bool

allow the user to select text via browser native text selection

§scroll_cursor_into_view: bool

always put the cursor into view

§enable_context_menu: bool

show context menu when user right clicks on the editor

§enable_keypresses: bool

if enabled, the editor will listen to keypresses if disabled, it will not react to keypresses default: true

§enable_click: bool

clicking on the editor will set the cursor location at the click location

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Options

Source§

fn default() -> Options

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.