pub struct BeamtermRenderer { /* private fields */ }
Expand description
JavaScript wrapper for the terminal renderer
Implementations§
Source§impl BeamtermRenderer
impl BeamtermRenderer
Sourcepub fn new(canvas_id: &str) -> Result<BeamtermRenderer, JsValue>
pub fn new(canvas_id: &str) -> Result<BeamtermRenderer, JsValue>
Create a new terminal renderer
Sourcepub fn enable_selection(
&mut self,
mode: SelectionMode,
trim_whitespace: bool,
) -> Result<(), JsValue>
pub fn enable_selection( &mut self, mode: SelectionMode, trim_whitespace: bool, ) -> Result<(), JsValue>
Enable default mouse selection behavior with built-in copy to clipboard
Sourcepub fn set_mouse_handler(&mut self, handler: Function) -> Result<(), JsValue>
pub fn set_mouse_handler(&mut self, handler: Function) -> Result<(), JsValue>
Set a custom mouse event handler
Sourcepub fn copy_to_clipboard(&self, text: &str)
pub fn copy_to_clipboard(&self, text: &str)
Copy text to the system clipboard
Sourcepub fn clear_selection(&self)
pub fn clear_selection(&self)
Clear any active selection
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if there is an active selection
Sourcepub fn new_render_batch(&mut self) -> Batch
pub fn new_render_batch(&mut self) -> Batch
Create a new render batch
Sourcepub fn terminal_size(&self) -> Size
pub fn terminal_size(&self) -> Size
Get the terminal dimensions in cells
Trait Implementations§
Source§impl Debug for BeamtermRenderer
impl Debug for BeamtermRenderer
Source§impl From<BeamtermRenderer> for JsValue
impl From<BeamtermRenderer> for JsValue
Source§fn from(value: BeamtermRenderer) -> Self
fn from(value: BeamtermRenderer) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for BeamtermRenderer
impl FromWasmAbi for BeamtermRenderer
Source§impl IntoWasmAbi for BeamtermRenderer
impl IntoWasmAbi for BeamtermRenderer
Source§impl OptionFromWasmAbi for BeamtermRenderer
impl OptionFromWasmAbi for BeamtermRenderer
Source§impl OptionIntoWasmAbi for BeamtermRenderer
impl OptionIntoWasmAbi for BeamtermRenderer
Source§impl RefFromWasmAbi for BeamtermRenderer
impl RefFromWasmAbi for BeamtermRenderer
Source§type Anchor = RcRef<BeamtermRenderer>
type Anchor = RcRef<BeamtermRenderer>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for BeamtermRenderer
impl RefMutFromWasmAbi for BeamtermRenderer
Source§impl TryFromJsValue for BeamtermRenderer
impl TryFromJsValue for BeamtermRenderer
Source§impl VectorFromWasmAbi for BeamtermRenderer
impl VectorFromWasmAbi for BeamtermRenderer
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[BeamtermRenderer]>
Source§impl VectorIntoJsValue for BeamtermRenderer
impl VectorIntoJsValue for BeamtermRenderer
fn vector_into_jsvalue(vector: Box<[BeamtermRenderer]>) -> JsValue
Source§impl VectorIntoWasmAbi for BeamtermRenderer
impl VectorIntoWasmAbi for BeamtermRenderer
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[BeamtermRenderer]>) -> Self::Abi
Source§impl WasmDescribeVector for BeamtermRenderer
impl WasmDescribeVector for BeamtermRenderer
impl SupportsConstructor for BeamtermRenderer
impl SupportsInstanceProperty for BeamtermRenderer
impl SupportsStaticProperty for BeamtermRenderer
Auto Trait Implementations§
impl Freeze for BeamtermRenderer
impl !RefUnwindSafe for BeamtermRenderer
impl !Send for BeamtermRenderer
impl !Sync for BeamtermRenderer
impl Unpin for BeamtermRenderer
impl !UnwindSafe for BeamtermRenderer
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.