Skip to main content

Method

Enum Method 

Source
pub enum Method {
    Handshake,
    WidgetTree,
    WidgetProps,
    FrameStatsSubscribe,
    FrameStats,
    MetricsSnapshot,
    InputTap,
    InputScroll,
    InputText,
    Screenshot,
}
Expand description

A devtools protocol v1 method name, typed. crate::Request::method/ crate::Notification::method carry the plain String on the wire (JSON-RPC has no closed method set, and an unrecognized method must still decode — see docs/CODE_STANDARDS.md’s Naming Conventions and this crate’s forward-compat testing); a caller matches the decoded string against Method::from_str to dispatch, treating None as “unknown method” (→ RpcError::METHOD_NOT_FOUND on a server, or an ignored push on a client).

Variants§

§

Handshake

Client→server request; result: crate::HandshakeInfo.

§

WidgetTree

Client→server request; result: crate::WidgetTreeDump.

§

WidgetProps

Client→server request; params: crate::WidgetPropsParams; result: crate::WidgetProps.

§

FrameStatsSubscribe

Client→server request; result: crate::AckResult. Arms the server to start pushing FrameStats notifications.

§

FrameStats

Server→client notification; payload: crate::FrameStats.

§

MetricsSnapshot

Client→server request; result: crate::MetricsSnapshot.

§

InputTap

Client→server request; params: crate::InputTapParams; result: crate::AckResult.

§

InputScroll

Client→server request; params: crate::InputScrollParams; result: crate::AckResult.

§

InputText

Client→server request; params: crate::InputTextParams; result: crate::AckResult.

§

Screenshot

Client→server request; result: crate::ScreenshotResult, or RpcError::NOT_SUPPORTED on a server with no Screenshot capability.

Implementations§

Source§

impl Method

Source

pub fn as_str(self) -> &'static str

The wire method name — the exact "method" field value.

Source

pub fn from_str(s: &str) -> Option<Method>

Parses a wire method name into its typed variant. Returns None for any name outside the v1 set — the caller’s own dispatch decides what an unrecognized method means (unknown-method tolerance is a decode concern for crate::Request/crate::Notification themselves, not this lookup).

Deliberately an inherent method returning Option, not a std::str::FromStr impl: an unrecognized method is an ordinary, expected case here (any future-protocol or peer-defined method name), not an error a caller needs FromStr’s Result/Err-type machinery for.

Trait Implementations§

Source§

impl Clone for Method

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Method

Source§

impl Debug for Method

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Method

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Method

Source§

impl Hash for Method

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Method

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Method

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.