loro_ffi/
container.rs

1mod counter;
2mod list;
3mod map;
4mod movable_list;
5mod text;
6mod tree;
7mod unknown;
8
9pub use counter::LoroCounter;
10pub use list::{Cursor, LoroList};
11pub use map::LoroMap;
12pub use movable_list::LoroMovableList;
13pub use text::LoroText;
14pub use tree::{LoroTree, TreeParentId};
15pub use unknown::LoroUnknown;
16
17use crate::{ContainerID, ContainerType};
18
19pub trait ContainerIdLike: Send + Sync {
20    fn as_container_id(&self, ty: ContainerType) -> ContainerID;
21}
22
23impl ContainerIdLike for ContainerID {
24    fn as_container_id(&self, _ty: ContainerType) -> ContainerID {
25        self.clone()
26    }
27}
28
29impl ContainerIdLike for String {
30    fn as_container_id(&self, ty: ContainerType) -> ContainerID {
31        ContainerID::Root {
32            name: String::from(self),
33            container_type: ty,
34        }
35    }
36}