pub struct DevTools { /* private fields */ }Expand description
The inspector. Create with cx.new(|cx| DevTools::new(cx)).
Implementations§
Source§impl DevTools
impl DevTools
pub fn new(cx: &mut Context<'_, Self>) -> Self
Sourcepub fn tab(self, tab: DevToolsTab) -> Self
pub fn tab(self, tab: DevToolsTab) -> Self
Open on a particular tool.
Open the Elements sidebar on a particular pane.
pub fn active_tab(&self) -> DevToolsTab
pub fn set_tab(&mut self, tab: DevToolsTab, cx: &mut Context<'_, Self>)
Sourcepub fn is_picking(&self) -> bool
pub fn is_picking(&self) -> bool
Whether the element picker is armed.
Sourcepub fn set_picking(&mut self, picking: bool, cx: &mut Context<'_, Self>)
pub fn set_picking(&mut self, picking: bool, cx: &mut Context<'_, Self>)
Arm or disarm the picker. The host is told, because the actual hit testing happens in the window, not here.
Sourcepub fn pick_at(
&mut self,
point: Point<Pixels>,
cx: &mut Context<'_, Self>,
) -> bool
pub fn pick_at( &mut self, point: Point<Pixels>, cx: &mut Context<'_, Self>, ) -> bool
Select the element at a window point — what a host wires its picker to. Returns whether anything was under it.
Sourcepub fn selected_bounds(&self) -> Option<Bounds<Pixels>>
pub fn selected_bounds(&self) -> Option<Bounds<Pixels>>
The bounds of the selected element, for a host that paints a highlight over its own window.
Sourcepub fn reveal_source(&mut self, source: SourceRef, cx: &mut Context<'_, Self>)
pub fn reveal_source(&mut self, source: SourceRef, cx: &mut Context<'_, Self>)
Switch to Sources on source, and tell the host in case it would rather
open the file in a real editor.
Sourcepub fn toggle_drawer(&mut self, cx: &mut Context<'_, Self>)
pub fn toggle_drawer(&mut self, cx: &mut Context<'_, Self>)
Toggle the logs drawer.
Trait Implementations§
impl EventEmitter<DevToolsEvent> for DevTools
Source§impl Focusable for DevTools
impl Focusable for DevTools
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for DevTools
impl !Send for DevTools
impl !Sync for DevTools
impl !UnwindSafe for DevTools
impl Freeze for DevTools
impl Unpin for DevTools
impl UnsafeUnpin for DevTools
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
Mutably borrows from an owned value. Read more
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>
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>
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)
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)
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> 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> ⓘ
Converts
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> ⓘ
Converts
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