Skip to main content

FrameParams

Struct FrameParams 

Source
pub struct FrameParams<'a> {
    pub is_tty: bool,
    pub viewport_rows: usize,
    pub output: &'a str,
    pub output_height: usize,
    pub static_output: &'a str,
    pub is_unmounting: bool,
    pub cursor_dirty: bool,
    pub cursor: Option<CursorPos>,
    pub interactive: Option<bool>,
    pub is_in_ci: bool,
    pub debug: bool,
}
Expand description

Per-frame inputs to FrameWriter::write_frame.

Each field is an explicit parameter for what ink reads from the stream, the render result, or process.env, so the writer performs no IO.

Fields§

§is_tty: bool

stdout.isTTY — gates fullscreen detection, clear decisions, and sync.

§viewport_rows: usize

Terminal height in rows (getWindowSize(stdout).rows). Per-call, not constructor state: a viewport resize changes it between frames.

§output: &'a str

The rendered main output (no trailing newline added yet).

§output_height: usize

The rendered output’s height in rows (outputHeight).

§static_output: &'a str

New <Static> output for this frame, or "" when there is none. A bare "\n" is treated as no static content (ink.tsx:548 staticOutput !== '\n'). Real static output is accumulated into the writer’s full-static buffer.

§is_unmounting: bool

Whether this is the final teardown render (this.isUnmounting).

§cursor_dirty: bool

log.isCursorDirty() — retained on the params for the napi plumbing and the historical steady-gate contract, but the cursor-RENDER gate now keys off cursor vs the writer’s previous_cursor_position (the oracle’s hasChanges is str !== previousOutput || cursorChanged, log-update.ts:44-53cursorDirty itself is NOT in that predicate; it only selects activeCursor upstream). Defaults false; on every zero-flicker golden path it is false, so it never opens a gate.

§cursor: Option<CursorPos>

The ACTIVE cursor for this frame — ink’s activeCursor = cursorDirty ? cursorPosition : undefined (log-update.ts:43), resolved by the caller (napi) so the writer only sees the already-gated value. None mirrors no active cursor. The writer composes the ink-faithful cursor escape bytes (suffix / cursor-only sequence / hide) from this against its previous_cursor_position. On EVERY zero-flicker golden path this is None, which makes every new cursor branch a provable no-op (cursor_changed = false, all cursor builders return ""), so the golden bytes are byte-identical.

§interactive: Option<bool>

interactive option (interactive ?? !isInCi for sync). None defers to is_in_ci.

§is_in_ci: bool

CI detection result (ink’s is-in-ci), hoisted out of this crate.

§debug: bool

options.debug — plain full-frame mode: no diff, clear, or sync wrap.

Trait Implementations§

Source§

impl<'a> Clone for FrameParams<'a>

Source§

fn clone(&self) -> FrameParams<'a>

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<'a> Debug for FrameParams<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for FrameParams<'a>

§

impl<'a> RefUnwindSafe for FrameParams<'a>

§

impl<'a> Send for FrameParams<'a>

§

impl<'a> Sync for FrameParams<'a>

§

impl<'a> Unpin for FrameParams<'a>

§

impl<'a> UnsafeUnpin for FrameParams<'a>

§

impl<'a> UnwindSafe for FrameParams<'a>

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