35 lines
516 B
Rust
35 lines
516 B
Rust
use std::rc::Rc;
|
|
|
|
use crate::screen::Screen;
|
|
|
|
pub struct DeviceT {
|
|
pub screen: Screen
|
|
}
|
|
|
|
impl DeviceT {
|
|
fn new() -> Self {
|
|
let screen = Screen::new();
|
|
|
|
DeviceT {
|
|
screen
|
|
}
|
|
}
|
|
}
|
|
|
|
pub struct Device {
|
|
pub shared: Rc<DeviceT>
|
|
}
|
|
|
|
impl Device {
|
|
pub fn new() -> Self {
|
|
return Device {
|
|
shared: Rc::new(DeviceT::new())
|
|
}
|
|
}
|
|
|
|
pub fn share(&self) -> Self {
|
|
return Device {
|
|
shared: self.shared.clone()
|
|
}
|
|
}
|
|
} |