mirror of
https://github.com/hexedtech/codemp-proto.git
synced 2024-12-23 05:44:52 +01:00
chore: do not namespace as proto
This commit is contained in:
parent
4347dfa9d7
commit
460ef34712
1 changed files with 42 additions and 62 deletions
104
src/lib.rs
104
src/lib.rs
|
@ -1,67 +1,47 @@
|
|||
#[allow(non_snake_case)]
|
||||
pub mod proto {
|
||||
pub mod common {
|
||||
tonic::include_proto!("common");
|
||||
pub mod common {
|
||||
tonic::include_proto!("common");
|
||||
|
||||
impl From<uuid::Uuid> for Identity {
|
||||
fn from(id: uuid::Uuid) -> Self {
|
||||
Identity { id: id.to_string() }
|
||||
}
|
||||
impl From<uuid::Uuid> for Identity {
|
||||
fn from(id: uuid::Uuid) -> Self {
|
||||
Identity { id: id.to_string() }
|
||||
}
|
||||
|
||||
impl From<&uuid::Uuid> for Identity {
|
||||
fn from(id: &uuid::Uuid) -> Self {
|
||||
Identity { id: id.to_string() }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Identity> for uuid::Uuid {
|
||||
fn from(value: Identity) -> Self {
|
||||
uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity")
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Identity> for uuid::Uuid {
|
||||
fn from(value: &Identity) -> Self {
|
||||
uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod files {
|
||||
tonic::include_proto!("files");
|
||||
|
||||
impl From<String> for BufferNode {
|
||||
fn from(value: String) -> Self {
|
||||
BufferNode { path: value }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for BufferNode {
|
||||
fn from(value: &str) -> Self {
|
||||
BufferNode {
|
||||
path: value.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BufferNode> for String {
|
||||
fn from(value: BufferNode) -> Self {
|
||||
value.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod buffer {
|
||||
tonic::include_proto!("buffer");
|
||||
}
|
||||
pub mod cursor {
|
||||
tonic::include_proto!("cursor");
|
||||
}
|
||||
pub mod workspace {
|
||||
tonic::include_proto!("workspace");
|
||||
}
|
||||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
}
|
||||
|
||||
pub mod files {
|
||||
tonic::include_proto!("files");
|
||||
|
||||
impl From<String> for BufferNode {
|
||||
fn from(value: String) -> Self {
|
||||
BufferNode { path: value }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for BufferNode {
|
||||
fn from(value: &str) -> Self {
|
||||
BufferNode {
|
||||
path: value.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BufferNode> for String {
|
||||
fn from(value: BufferNode) -> Self {
|
||||
value.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod buffer {
|
||||
tonic::include_proto!("buffer");
|
||||
}
|
||||
pub mod cursor {
|
||||
tonic::include_proto!("cursor");
|
||||
}
|
||||
pub mod workspace {
|
||||
tonic::include_proto!("workspace");
|
||||
}
|
||||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue