Skip to main content

BridgeOptions

Struct BridgeOptions 

Source
pub struct BridgeOptions {
    pub code_block_background: [f32; 4],
    pub code_block_foreground: Option<[f32; 4]>,
    pub echo_char: Option<char>,
}
Expand description

Per-call knobs threaded through the conversion functions so that a host widget can override defaults driven by its active theme.

Default values reproduce the historical pre-themed behaviour: a light-grey card behind fenced code blocks and no foreground override for monospaced runs.

Fields§

§code_block_background: [f32; 4]

Background painted behind blocks where BlockFormat.is_code_block == Some(true) AND the block carries no explicit background_color. Has no effect on prose blocks or blocks that set their own background.

§code_block_foreground: Option<[f32; 4]>

Foreground used for character runs whose font family resolves to monospace (set by the markdown importer for inline code spans and by is_code_block blocks). None keeps the engine-level default text colour. Only applied when the run carries no explicit foreground_color.

§echo_char: Option<char>

When Some(c), every character of every block laid out with these options is replaced with c — one echo char per source char — before shaping. This is the password / secure-field masking path: the real text never reaches the shaper or the glyph atlas, only the echo character does. Emitting one echo per source char (not per grapheme) preserves char counts, so the engine’s char-indexed caret / selection / hit-test stay aligned with the host document’s positions. None (default) lays text out verbatim.

Trait Implementations§

Source§

impl Clone for BridgeOptions

Source§

fn clone(&self) -> BridgeOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for BridgeOptions

Source§

fn default() -> Self

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

impl Copy for BridgeOptions

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<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.