mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-12-22 16:35:51 -05:00
Error and basic protocol handling
This commit is contained in:
parent
5e75370a67
commit
ae68fdd896
|
@ -6,4 +6,7 @@ use thiserror::Error;
|
|||
pub type Result<T, E = Error> = result::Result<T, E>;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {}
|
||||
pub enum Error {
|
||||
#[error("command from client not recognized")]
|
||||
CommandNotFound,
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use serde_json::json;
|
||||
//use serde_json::json;
|
||||
//use serde_json::Result;
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
||||
|
@ -32,7 +32,7 @@ fn u32_from_string<'de, D>(deserializer: D) -> Result<u32, D::Error>
|
|||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
let s: String = Deserialize::deserialize(deserializer)?;
|
||||
let _s: String = Deserialize::deserialize(deserializer)?;
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ fn u64_from_string<'de, D>(deserializer: D) -> Result<u64, D::Error>
|
|||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
let s: String = Deserialize::deserialize(deserializer)?;
|
||||
let _s: String = Deserialize::deserialize(deserializer)?;
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
pub mod error;
|
||||
pub mod event;
|
||||
pub mod proto;
|
||||
|
|
Loading…
Reference in New Issue
Block a user