devtools/actors/
pause.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use serde_json::{Map, Value};
6
7use crate::StreamId;
8use crate::actor::{Actor, ActorError, ActorRegistry};
9use crate::protocol::ClientRequest;
10
11// TODO: Remove once the actor is used.
12#[allow(dead_code)]
13/// Referenced by `ThreadActor` when replying to `interupt` messages.
14/// <https://searchfox.org/firefox-main/source/devtools/server/actors/thread.js#1699>
15pub struct PauseActor {
16    pub name: String,
17}
18
19impl Actor for PauseActor {
20    fn name(&self) -> String {
21        self.name.clone()
22    }
23
24    fn handle_message(
25        &self,
26        _request: ClientRequest,
27        _registry: &ActorRegistry,
28        _msg_type: &str,
29        _msg: &Map<String, Value>,
30        _id: StreamId,
31    ) -> Result<(), ActorError> {
32        // TODO: Handle messages.
33        Err(ActorError::UnrecognizedPacketType)
34    }
35}