Skip to main content

Target

Struct Target 

Source
pub struct Target {
    pub tree_kind: TreeKind,
    /* private fields */
}

Fields§

§tree_kind: TreeKind

The tree of the snapshots: visual or logical.

Implementations§

Source§

impl Target

Source

pub fn new(root: &Ref<TopLevel>) -> Self

A target on the shared inspector of this thread.

Source

pub fn with_inspector( inspector: Rc<RefCell<Inspector>>, root: &Ref<TopLevel>, ) -> Self

Source

pub fn root(&self) -> InspectResult<Ref<TopLevel>>

Source

pub fn id_for(&mut self, element: &Ref<StyledElement>) -> NodeId

Source

pub fn snapshot(&mut self) -> InspectResult<Vec<Node>>

Source

pub fn element(&mut self, id: NodeId) -> InspectResult<Ref<StyledElement>>

The element of a node of the current tree.

Source

pub fn query( &mut self, scope: Option<NodeId>, query: &str, ) -> InspectResult<Vec<NodeId>>

The nodes below scope (the whole tree without one) that match the selector, in document order. Uses the framework’s selector syntax and matching rules (including logical ancestry).

Source

pub fn properties(&mut self, id: NodeId) -> InspectResult<Vec<Property>>

Source

pub fn set_attribute( &mut self, id: NodeId, name: &str, value: &str, ) -> InspectResult<()>

class replaces the classes (not the pseudo-classes); any other name sets the local value of a property from text. The name of an element cannot change after it has been styled.

Source

pub fn matched_styles(&mut self, id: NodeId) -> InspectResult<Vec<MatchedStyle>>

The active frames that apply to the node, with their setters.

Source

pub fn box_model(&mut self, id: NodeId) -> InspectResult<BoxModel>

Source

pub fn bounds(&self) -> InspectResult<Rect>

The bounds of the top level, from its origin.

Source

pub fn screenshot(&self) -> InspectResult<Vec<u8>>

A PNG of the whole top level.

Source

pub fn hide_highlight(&mut self)

Source

pub fn highlight(&mut self, id: NodeId) -> InspectResult<()>

Auto Trait Implementations§

§

impl !RefUnwindSafe for Target

§

impl !Send for Target

§

impl !Sync for Target

§

impl !UnwindSafe for Target

§

impl Freeze for Target

§

impl Unpin for Target

§

impl UnsafeUnpin for Target

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.