You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bromine/src/namespaces/namespace.rs

22 lines
431 B
Rust

use crate::events::event_handler::EventHandler;
use std::sync::Arc;
#[derive(Clone)]
pub struct Namespace {
name: String,
pub(crate) handler: Arc<EventHandler>,
}
impl Namespace {
pub fn new<S: ToString>(name: S, handler: EventHandler) -> Self {
Self {
name: name.to_string(),
handler: Arc::new(handler),
}
}
pub fn name(&self) -> &String {
&self.name
}
}