[−][src]Struct ytesrev::latex::latex_obj::LatexObj
Represents a LaTeX expression. When loaded, this will create a PNG of the expression and load it.
Fields
inner: Option<PngImage>
The rendered document
expr: &'static str
The LaTeX expression that will be rendered
is_text: bool
A LaTeX expression can either be text or math, with math being surrounded by dollar sings
Methods
impl LatexObj
[src]
pub fn math(expr: &'static str) -> LatexObj
[src]
Create a LaTeX object containing math
use ytesrev::latex::LatexObj; let e_mc2 = LatexObj::math("E = mc^2"); assert!(!e_mc2.is_text); assert_eq!(e_mc2.expr, "E = mc^2");
pub fn text(expr: &'static str) -> LatexObj
[src]
Create a LaTeX object containing text
use ytesrev::latex::LatexObj; let lorem = LatexObj::text("Lorem Ipsum"); assert!(lorem.is_text); assert_eq!(lorem.expr, "Lorem Ipsum");
Trait Implementations
impl Drawable for LatexObj
[src]
fn content(&self) -> Vec<&dyn Drawable>
[src]
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
[src]
fn draw(
&self,
canvas: &mut Canvas<Window>,
position: &Position,
settings: DrawSettings
)
[src]
&self,
canvas: &mut Canvas<Window>,
position: &Position,
settings: DrawSettings
)
fn register(&mut self)
[src]
fn load(&mut self)
[src]
fn step(&mut self)
[src]
fn state(&self) -> State
[src]
fn event(&mut self, e: Event)
[src]
When any event occurs
fn update(&mut self, dt: f64)
[src]
Tick the object
impl KnownSize for LatexObj
[src]
impl ImageContainer for LatexObj
[src]
Auto Trait Implementations
impl Sync for LatexObj
impl Send for LatexObj
impl Unpin for LatexObj
impl RefUnwindSafe for LatexObj
impl UnwindSafe for LatexObj
Blanket Implementations
impl<T> Layerable for T where
T: Drawable,
[src]
T: Drawable,
fn as_drawable(&Self) -> &dyn Drawable
[src]
fn as_drawable_mut(&mut Self) -> &mut dyn Drawable
[src]
impl<T> Stackable for T where
T: Drawable + KnownSize,
[src]
T: Drawable + KnownSize,
fn as_drawable(&Self) -> &dyn Drawable
[src]
fn as_drawable_mut(&mut Self) -> &mut dyn Drawable
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,