monsta_client/
metadata.rs

1pub struct DatabaseSpec(monsta_proto::DatabaseSpec);
2
3impl Into<monsta_proto::DatabaseSpec> for DatabaseSpec {
4    fn into(self) -> monsta_proto::DatabaseSpec {
5        self.0
6    }
7}
8
9impl From<&str> for DatabaseSpec {
10    fn from(name: &str) -> Self {
11        Self(monsta_proto::DatabaseSpec {
12            name: name.to_owned(),
13        })
14    }
15}
16
17impl From<String> for DatabaseSpec {
18    fn from(name: String) -> Self {
19        Self(monsta_proto::DatabaseSpec { name })
20    }
21}
22
23pub struct CollectionSpec(monsta_proto::CollectionSpec);
24
25impl Into<monsta_proto::CollectionSpec> for CollectionSpec {
26    fn into(self) -> monsta_proto::CollectionSpec {
27        self.0
28    }
29}
30
31impl From<&str> for CollectionSpec {
32    fn from(name: &str) -> Self {
33        Self(monsta_proto::CollectionSpec {
34            name: name.to_owned(),
35            ..Default::default()
36        })
37    }
38}
39
40impl From<String> for CollectionSpec {
41    fn from(name: String) -> Self {
42        Self(monsta_proto::CollectionSpec {
43            name,
44            ..Default::default()
45        })
46    }
47}