Skip to main content

BlockExtractor

Struct BlockExtractor 

Source
pub struct BlockExtractor { /* private fields */ }

Implementations§

Source§

impl BlockExtractor

Source

pub fn new(cap: usize) -> Self

Source

pub fn stamp_yurai(&mut self, y: Yurai) -> bool

Stamp the owning pane’s provenance onto this extractor — write-once, and that is the whole point.

Yurai is documented as a pane’s provenance for its whole life, so a settable field would contradict the type it carries: an agent-spawned pane could re-stamp itself Human mid-session and every block after that point would lie, retroactively laundering the history a freio press is supposed to be able to trust.

So the second call is refused rather than applied. Returns true when this call took effect. A refusal is not an error — re-stamping the SAME provenance is harmless and idempotent — but a refusal that would have CHANGED the value is a caller bug, and the return value is how a caller can notice.

Tier-honest: only-mitigated. Yurai::Automation is a public variant, so in-process code can construct a provenance without holding an attested connection; what is closed here is drift after the fact, not fabrication at the source. Fabrication is bounded by tear_types::Yurai::from_shutai being the only production path, which is convention plus its own tests — not a compile error.

Source

pub fn yurai(&self) -> &Yurai

The provenance every block from this extractor carries.

Source

pub fn set_cwd_from_osc7(&mut self, raw: &str)

Record the shell’s current working directory. Called by the OSC 7 hook in GridState — the next prompt-start stamps this onto the new block. OSC 7 payload is typically file://<host>/path/to/dir; we strip the scheme + host to keep just the absolute path.

Source

pub fn current_cwd(&self) -> Option<&str>

Current OSC 7-set cwd, if any. Surfaced for tests and for renderers that want to display the active directory independent of any open block.

Source

pub fn len(&self) -> usize

Number of completed blocks currently retained.

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter(&self) -> impl Iterator<Item = &Block>

Iterate completed blocks oldest-first.

Source

pub fn get(&self, index: u64) -> Option<&Block>

Fetch a single block by its per-pane index. Returns None when the block has been evicted (index < oldest) or never existed (index > latest completed).

Source

pub fn current(&self) -> Option<&Block>

In-progress block (if any). Useful for live “what’s running right now” introspection.

Source

pub fn on_print(&mut self, c: char)

Append a printable char to whatever phase we’re in. No-op when Idle. Called from the vte Perform::print hook.

Source

pub fn on_raw_byte(&mut self, b: u8)

Append raw bytes (for non-Print events like CR/LF/Esc). The output phase wants the full byte stream so a replayer can reproduce escape sequences. Phases Prompt/Command keep only printable chars (escapes there are usually terminal-renderer concerns).

Source

pub fn on_osc_133(&mut self, marker: &str)

Handle an OSC 133 marker. marker is the second OSC param (the A / B / C / D[;<n>] part).

Trait Implementations§

Source§

impl Default for BlockExtractor

Source§

fn default() -> Self

Returns the “default value” for a 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more