pub struct MathView {
pub start_row: u32,
pub end_row: u32,
pub inline: bool,
pub tex: String,
pub display: bool,
pub src: u32,
}Expand description
One formula standing as a picture: what to typeset and where its picture
goes. The peer of leaf_core::MathInfo. Two shapes:
- Inline (
inline == true): one row, and on it exactly one run with rolemathwhosesrcequals thissrc— a single∑standing for the whole formula. The renderer typesets the TeX at the run’s font size (typeset_math) and draws the picture in the run’s place with the text baseline through it at the picture’s height: a run delegate on Apple. The run is a caret stop at the formula’s start; the one after it is the next run’s first character. - Block (
inline == false): the rows instart_row..end_roware the placeholder, exactly aMediaView’s shape — the renderer skips them and lays the typeset picture over them, centred on the measure.
A formula on the caret’s line is not here: there it is its TeX, drawn as
code runs between delimiter runs, in every markup mode.
Fields§
§start_row: u32The DocView::rows indices the formula occupies — its own row for an
inline one, the placeholder and its fillers for a block.
end_row: u32§inline: boolWhether this is an atom in a line of text, or a block of its own.
tex: StringThe TeX between the delimiters, verbatim. What typeset_math takes.
display: boolDisplay style (limits above and below, full-height fractions) rather
than text style — a $$…$$, inline or not.
src: u32The formula’s source start: what the math run’s src carries, and
where a click on the picture lands the caret.
Trait Implementations§
Source§impl<UT> ConvertError<UT> for MathView
impl<UT> ConvertError<UT> for MathView
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<UT> FfiConverter<UT> for MathView
impl<UT> FfiConverter<UT> for MathView
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Type ID metadata, serialized into a MetadataBuffer.
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
The low-level type used for passing values of this type over the FFI. Read more
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§impl<UT> LiftReturn<UT> for MathView
impl<UT> LiftReturn<UT> for MathView
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Lift a successfully returned value from a trait interface
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Lift a foreign returned value from a trait interface Read more
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Lift a Rust value for a callback interface method error result Read more
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Lift a Rust value for an unexpected callback interface error Read more
Source§impl<UT> LowerError<UT> for MathView
impl<UT> LowerError<UT> for MathView
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for MathView
impl<UT> LowerReturn<UT> for MathView
Source§type ReturnType = <MathView as Lower<UT>>::FfiType
type ReturnType = <MathView as Lower<UT>>::FfiType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Auto Trait Implementations§
impl Freeze for MathView
impl RefUnwindSafe for MathView
impl Send for MathView
impl Sync for MathView
impl Unpin for MathView
impl UnsafeUnpin for MathView
impl UnwindSafe for MathView
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