1use crate::CapabilityBound;
5use fidl_fuchsia_component_sandbox as fsandbox;
6use std::fmt::Debug;
7
8#[derive(Debug, Clone, Default, PartialEq, Eq)]
9pub struct Unit;
10
11impl From<Unit> for fsandbox::Unit {
12 fn from(_unit: Unit) -> Self {
13 Self {}
14 }
15}
16
17impl From<Unit> for fsandbox::Capability {
18 fn from(unit: Unit) -> Self {
19 Self::Unit(unit.into())
20 }
21}
22
23impl CapabilityBound for Unit {
24 fn debug_typename() -> &'static str {
25 "Unit"
26 }
27}
28
29#[cfg(test)]
30mod tests {
31 use super::*;
32
33 #[test]
34 fn test_into_fidl() {
35 let unit = Unit::default();
36 let fidl_capability: fsandbox::Capability = unit.into();
37 assert_eq!(fidl_capability, fsandbox::Capability::Unit(fsandbox::Unit {}));
38 }
39}