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
impl Method
Sourcepub fn from_str(s: &str) -> Option<Method>
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.