moved the InputValidationError to the top of server.rs
This commit is contained in:
parent
949969b47e
commit
ec0df1959e
1 changed files with 14 additions and 15 deletions
|
@ -21,6 +21,20 @@ struct JsonRpcRequest {
|
||||||
params: JsonValue,
|
params: JsonValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct InputValidationError(String);
|
||||||
|
impl Error for InputValidationError {}
|
||||||
|
|
||||||
|
impl Debug for InputValidationError {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "Error: {}", self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl Display for InputValidationError {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "Error: {}", self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) {
|
pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) {
|
||||||
let edges: Arc<RwLock<Arc<EdgeDB>>> = Arc::new(RwLock::new(Arc::new(EdgeDB::default())));
|
let edges: Arc<RwLock<Arc<EdgeDB>>> = Arc::new(RwLock::new(Arc::new(EdgeDB::default())));
|
||||||
|
|
||||||
|
@ -134,21 +148,6 @@ fn load_safes_binary(edges: &RwLock<Arc<EdgeDB>>, file: &str) -> Result<usize, B
|
||||||
Ok(len)
|
Ok(len)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InputValidationError(String);
|
|
||||||
|
|
||||||
impl Debug for InputValidationError {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(f, "Error: {}", self.0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
impl Display for InputValidationError {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(f, "Error: {}", self.0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Error for InputValidationError {}
|
|
||||||
|
|
||||||
fn compute_transfer(
|
fn compute_transfer(
|
||||||
request: JsonRpcRequest,
|
request: JsonRpcRequest,
|
||||||
edges: &EdgeDB,
|
edges: &EdgeDB,
|
||||||
|
|
Loading…
Reference in a new issue