pub struct MathField(/* private fields */);
Expand description
Wrapper around mathquill_js_sys::MathField
Implementations§
Source§impl MathField
impl MathField
Sourcepub fn latex(&self) -> String
pub fn latex(&self) -> String
Examples found in repository?
examples/field.rs (line 16)
7fn main() {
8 // getting this is usually the responsibility of
9 // a web framework, e.g. leptos
10 let element: web_sys::HtmlElement = todo!();
11 let mq = MathQuill::get_global_interface();
12
13 let mut config = Config::default();
14 config.handlers().on_edit_field(|| {
15 let field: Option<MathField> = MathQuill::get_global_interface().get_field(&element);
16 let latex = field.unwrap().latex();
17 check_answer(latex);
18 });
19
20 let _field = mq.mount_field(&element, &config);
21
22 // dropping config invalidates closures,
23 // read docs on Config
24}
pub fn set_latex(&self, latex: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MathField
impl RefUnwindSafe for MathField
impl !Send for MathField
impl !Sync for MathField
impl Unpin for MathField
impl UnwindSafe for MathField
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