devtools/actors/inspector/
simulator.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 malloc_size_of_derive::MallocSizeOf;
6
7use crate::actor::{Actor, ActorRegistry};
8
9#[derive(MallocSizeOf)]
10pub(crate) struct SimulatorActor {
11    name: String,
12}
13
14impl SimulatorActor {
15    pub fn register(registry: &ActorRegistry) -> String {
16        let name = registry.new_name::<Self>();
17        let actor = Self { name: name.clone() };
18        registry.register::<Self>(actor);
19        name
20    }
21}
22
23impl Actor for SimulatorActor {
24    fn name(&self) -> String {
25        self.name.clone()
26    }
27}