pub struct PreviewCtx {
pub show_hidden: bool,
pub worker_tx: Sender<WorkerMsg>,
pub generation: u64,
pub text_sync_threshold_bytes: usize,
pub max_preview_lines: usize,
}Expand description
Context passed to PreviewProvider::preview.
Carries shared resources that providers may need without storing them on
AppState directly. Phase 5 adds worker_tx and generation so async
providers can tag their results with the current generation counter and
send them back over the shared worker channel.
Fields§
Whether hidden entries should appear in directory previews.
worker_tx: Sender<WorkerMsg>Sender half of the shared worker channel. Async providers use this to
send WorkerMsg::Preview / WorkerMsg::ImageMeta results back to the
UI thread.
generation: u64The generation counter at the time the preview was requested.
Async providers tag their WorkerMsg with this value; workers::merge
drops results whose generation no longer matches state.preview.generation.
text_sync_threshold_bytes: usizeMaximum file size to preview synchronously on the UI thread.
max_preview_lines: usizeMaximum number of lines a text preview loads, from [preview] max_lines.
The preview scrolls within this window; a file with more lines is
reported as truncated rather than silently cut. Read when the preview is
requested, so a :set of the key takes effect from the next preview on.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PreviewCtx
impl RefUnwindSafe for PreviewCtx
impl Send for PreviewCtx
impl Sync for PreviewCtx
impl Unpin for PreviewCtx
impl UnsafeUnpin for PreviewCtx
impl UnwindSafe for PreviewCtx
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more