Skip to main content

RenderOpts

Struct RenderOpts 

Source
pub struct RenderOpts {
    pub cols: u16,
    pub rows: u16,
    pub color_level: u8,
    pub include_plain_output: Option<bool>,
}
Expand description

Per-render geometry (render_frame’s opts arg). cols is the terminal width handed to the core layout; rows is the viewport height fed to write_frame’s fullscreen/clear decisions.

Fields§

§cols: u16§rows: u16§color_level: u8

Detected terminal color level (chalk’s chalk.level, 0–3). The JS drop-in reads the GLOBAL chalk.level — exactly what ink uses and what the conformance harness forces to 3 — and threads it here. Core colorize emits SGR at this level for the core-colorize call sites (borders; Box backgroundColor fill). <Text> color is colorized JS-side by chalk (already level-aware) and arrives pre-styled. 0 → no SGR (non-color terminal); 1/2 → downgraded codes; 3 → truecolor (the prior behavior).

§include_plain_output: Option<bool>

Whether to include plain_output in the FrameResult. When explicitly false, the result’s plain_output is an empty string — the render_styled computation still runs (its output is the transport input), but the string is not marshaled back across the FFI boundary. None (absent from JS) or true returns the full string, preserving backward compatibility for callers that do not set it (e.g. the test harness).

Trait Implementations§

Source§

impl FromNapiValue for RenderOpts

Source§

unsafe fn from_napi_value( env: napi_env, napi_val: napi_value, ) -> Result<RenderOpts>

This function called to convert napi values to native rust values Read more
Source§

fn from_unknown(value: Unknown<'_>) -> Result<Self, Error>

Source§

impl ToNapiValue for RenderOpts

Source§

unsafe fn to_napi_value(env: napi_env, val: RenderOpts) -> Result<napi_value>

This function called to convert rust values to napi values Read more
Source§

fn into_unknown(self, env: &Env) -> Result<Unknown<'_>, Error>

Source§

impl TypeName for RenderOpts

Source§

impl ValidateNapiValue for RenderOpts

Source§

unsafe fn validate( env: *mut napi_env__, napi_val: *mut napi_value__, ) -> Result<*mut napi_value__, Error>

This function called to validate whether napi value passed to rust is valid type. Read more

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> 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> JsValuesTupleIntoVec for T
where T: ToNapiValue,

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.