pub struct ScriptViewConfig { /* private fields */ }Implementations§
Source§impl ScriptViewConfig
impl ScriptViewConfig
pub fn new(view_id: impl Into<String>) -> Self
pub const fn paint_background(self, paint: bool) -> Self
Control the built-in selectable runtime-error banner for this view.
Hosts that disable it must surface ScriptViewHandle::last_error
themselves so failed candidates are not silent.
Sourcepub fn on_error(
self,
observer: impl Fn(&ScriptErrorReport, &mut App) + 'static,
) -> Self
pub fn on_error( self, observer: impl Fn(&ScriptErrorReport, &mut App) + 'static, ) -> Self
Call observer once for each new failure of this view: the render,
callback, delivery, effect or reload error that
ScriptViewHandle::last_error then reports. It runs on the
foreground after the frame that presents the failure, so it may read
the handle; several failures before that frame report the latest, as
last_error does. Recoverable image errors also report here with
domain == Presentation, deduplicated and bounded to 256 active entries
per view; they do not change last_error or roll back a transaction.
Script windows the view opens report through it too.
Sourcepub const fn mirror_errors_to_stderr(self, mirror: bool) -> Self
pub const fn mirror_errors_to_stderr(self, mirror: bool) -> Self
Also print each new failure to stderr, as
gpui-rhai: view `id`: message, so an unattended run fails loudly.
Off for an embedded view; ScriptApplication turns it on.
Sourcepub const fn window_drag_areas(self, enabled: bool) -> Self
pub const fn window_drag_areas(self, enabled: bool) -> Self
Let window_drag_area() nodes in this view move the window. Off by
default, so an embedded view cannot turn its content into a window
control surface; a Host that draws its own title bar (a transparent
TitlebarOptions) turns it on for the view that renders the bar.
Sourcepub const fn render_islands(self, enabled: bool) -> Self
pub const fn render_islands(self, enabled: bool) -> Self
Whether frames replay the unchanged parts of the view instead of
building them again (on by default). Turning it off renders every
frame in full, as 0.3.2 did, which also
GPUI_RHAI_RENDER_ISLANDS=off does for every view. Script windows
the view opens follow it.
Sourcepub const fn host_sets_width(self, fixed: bool) -> Self
pub const fn host_sets_width(self, fixed: bool) -> Self
Tell the view that the Host lays it out at a width its content does
not change, as when it fills a window or a pane the Host sizes. Frames
then also replay the unchanged subtrees whose width follows the
view’s, which they cannot otherwise tell from content. Off by default;
ScriptApplication windows are laid out so.
Sourcepub const fn focus_indicators(self, indicators: FocusIndicators) -> Self
pub const fn focus_indicators(self, indicators: FocusIndicators) -> Self
When the view shows focus indicators; FocusIndicators::Navigation
by default. Script windows the view opens follow it.
pub fn view_id(&self) -> &str
Trait Implementations§
Source§impl Clone for ScriptViewConfig
impl Clone for ScriptViewConfig
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptViewConfig
impl !Send for ScriptViewConfig
impl !Sync for ScriptViewConfig
impl !UnwindSafe for ScriptViewConfig
impl Forget for ScriptViewConfig
impl Freeze for ScriptViewConfig
impl Move for ScriptViewConfig
impl Unpin for ScriptViewConfig
impl UnsafeUnpin for ScriptViewConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.