itsi-scheduler 0.1.5 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of itsi-scheduler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75599726844e215e80b59ae8a95549e23024e4e070d768ca3f085a8fbb2591a9
4
- data.tar.gz: c84726c45c08562ad4b8ebd4a6c9eb4ebd1f50521afca027c1e6a69d8b2e4eb5
3
+ metadata.gz: 4608db7a6227b55d8ecea4a46ad9c4ff8b1df83ac3c563ceb05959921b66c1ab
4
+ data.tar.gz: 8a80d6ad6054e9299bec4ebe67fef75abd0e969141a613faedf4e3e24aa653af
5
5
  SHA512:
6
- metadata.gz: 0a944a2d952111520bf473853ec7b363ed16a53ddf4b0ae252c0fab36d70b4dedb561d55feab827d34c21b0d468cb6b0e978dba22584bc873092cc3d9515a7af
7
- data.tar.gz: 5e27924c41ebc8f6b84f8d1e507ff04d3d86d8326c2da21ca2cbe4b1fc703b7bd0026813cf8353775e126d562e25cae93ed8c03f714b07eb48c4d3e15b91fc94
6
+ metadata.gz: 3ddac9d8deb50306d4a25304a522361f8cad05a82e88a77fbe6899a2675d5a2c8c306967a0376190bb9b34883ffd2677ec6e3f9e03fd1bb85bc8ea07396a8053
7
+ data.tar.gz: 8644d0da8994fd68e938b257e76e56d00b2ee9d9784010ddcde6bb2454e776949af666ec7525b75800b7a80658d2092769ccca4c6979a3ec5beae77389949edf
data/Cargo.lock CHANGED
@@ -68,9 +68,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
68
68
 
69
69
  [[package]]
70
70
  name = "cc"
71
- version = "1.2.16"
71
+ version = "1.2.15"
72
72
  source = "registry+https://github.com/rust-lang/crates.io-index"
73
- checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
73
+ checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af"
74
74
  dependencies = [
75
75
  "shlex",
76
76
  ]
@@ -186,9 +186,9 @@ dependencies = [
186
186
 
187
187
  [[package]]
188
188
  name = "itoa"
189
- version = "1.0.15"
189
+ version = "1.0.14"
190
190
  source = "registry+https://github.com/rust-lang/crates.io-index"
191
- checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
191
+ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
192
192
 
193
193
  [[package]]
194
194
  name = "itsi-scheduler"
@@ -507,9 +507,9 @@ dependencies = [
507
507
 
508
508
  [[package]]
509
509
  name = "redox_syscall"
510
- version = "0.5.10"
510
+ version = "0.5.9"
511
511
  source = "registry+https://github.com/rust-lang/crates.io-index"
512
- checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
512
+ checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f"
513
513
  dependencies = [
514
514
  "bitflags",
515
515
  ]
@@ -560,9 +560,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
560
560
 
561
561
  [[package]]
562
562
  name = "ring"
563
- version = "0.17.11"
563
+ version = "0.17.14"
564
564
  source = "registry+https://github.com/rust-lang/crates.io-index"
565
- checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73"
565
+ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
566
566
  dependencies = [
567
567
  "cc",
568
568
  "cfg-if",
@@ -586,9 +586,9 @@ checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
586
586
 
587
587
  [[package]]
588
588
  name = "ryu"
589
- version = "1.0.20"
589
+ version = "1.0.19"
590
590
  source = "registry+https://github.com/rust-lang/crates.io-index"
591
- checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
591
+ checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd"
592
592
 
593
593
  [[package]]
594
594
  name = "scopeguard"
@@ -624,9 +624,9 @@ dependencies = [
624
624
 
625
625
  [[package]]
626
626
  name = "serde_json"
627
- version = "1.0.140"
627
+ version = "1.0.139"
628
628
  source = "registry+https://github.com/rust-lang/crates.io-index"
629
- checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
629
+ checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6"
630
630
  dependencies = [
631
631
  "itoa",
632
632
  "memchr",
@@ -1,5 +1,12 @@
1
+ use magnus::{
2
+ Error,
3
+ error::ErrorType,
4
+ exception::{self, arg_error, exception},
5
+ };
6
+ use nix::errno::Errno;
7
+
1
8
  use crate::ItsiError;
2
- use std::ffi::NulError;
9
+ use std::{ffi::NulError, io};
3
10
 
4
11
  pub static CLIENT_CONNECTION_CLOSED: &str = "Client disconnected";
5
12
 
@@ -9,14 +16,14 @@ impl From<httparse::Error> for ItsiError {
9
16
  }
10
17
  }
11
18
 
12
- impl From<nix::errno::Errno> for ItsiError {
13
- fn from(err: nix::errno::Errno) -> Self {
19
+ impl From<Errno> for ItsiError {
20
+ fn from(err: Errno) -> Self {
14
21
  ItsiError::ArgumentError(err.to_string())
15
22
  }
16
23
  }
17
24
 
18
- impl From<std::io::Error> for ItsiError {
19
- fn from(err: std::io::Error) -> Self {
25
+ impl From<io::Error> for ItsiError {
26
+ fn from(err: io::Error) -> Self {
20
27
  ItsiError::ArgumentError(err.to_string())
21
28
  }
22
29
  }
@@ -33,39 +40,29 @@ impl From<NulError> for ItsiError {
33
40
  }
34
41
  }
35
42
 
36
- impl From<magnus::Error> for ItsiError {
37
- fn from(err: magnus::Error) -> Self {
43
+ impl From<Error> for ItsiError {
44
+ fn from(err: Error) -> Self {
38
45
  match err.error_type() {
39
- magnus::error::ErrorType::Jump(tag) => ItsiError::Jump(tag.to_string()),
40
- magnus::error::ErrorType::Error(_exception_class, cow) => {
41
- ItsiError::ArgumentError(cow.to_string())
42
- }
43
- magnus::error::ErrorType::Exception(exception) => {
44
- ItsiError::ArgumentError(exception.to_string())
45
- }
46
+ ErrorType::Jump(tag) => ItsiError::Jump(tag.to_string()),
47
+ ErrorType::Error(_exception_class, cow) => ItsiError::ArgumentError(cow.to_string()),
48
+ ErrorType::Exception(exception) => ItsiError::ArgumentError(exception.to_string()),
46
49
  }
47
50
  }
48
51
  }
49
52
 
50
- impl From<ItsiError> for magnus::Error {
53
+ impl From<ItsiError> for Error {
51
54
  fn from(err: ItsiError) -> Self {
52
55
  match err {
53
- ItsiError::InvalidInput(msg) => magnus::Error::new(magnus::exception::arg_error(), msg),
54
- ItsiError::InternalServerError(msg) => {
55
- magnus::Error::new(magnus::exception::exception(), msg)
56
- }
57
- ItsiError::UnsupportedProtocol(msg) => {
58
- magnus::Error::new(magnus::exception::arg_error(), msg)
59
- }
60
- ItsiError::ArgumentError(msg) => {
61
- magnus::Error::new(magnus::exception::arg_error(), msg)
62
- }
63
- ItsiError::Jump(msg) => magnus::Error::new(magnus::exception::local_jump_error(), msg),
64
- ItsiError::Break() => magnus::Error::new(magnus::exception::interrupt(), "Break"),
56
+ ItsiError::InvalidInput(msg) => Error::new(arg_error(), msg),
57
+ ItsiError::InternalServerError(msg) => Error::new(exception(), msg),
58
+ ItsiError::UnsupportedProtocol(msg) => Error::new(arg_error(), msg),
59
+ ItsiError::ArgumentError(msg) => Error::new(arg_error(), msg),
60
+ ItsiError::Jump(msg) => Error::new(exception::local_jump_error(), msg),
61
+ ItsiError::Break() => Error::new(exception::interrupt(), "Break"),
65
62
  ItsiError::ClientConnectionClosed => {
66
- magnus::Error::new(magnus::exception::eof_error(), CLIENT_CONNECTION_CLOSED)
63
+ Error::new(exception::eof_error(), CLIENT_CONNECTION_CLOSED)
67
64
  }
68
- ItsiError::Pass() => magnus::Error::new(magnus::exception::interrupt(), "Pass"),
65
+ ItsiError::Pass() => Error::new(exception::interrupt(), "Pass"),
69
66
  }
70
67
  }
71
68
  }
@@ -3,7 +3,7 @@ use thiserror::Error;
3
3
 
4
4
  pub type Result<T> = std::result::Result<T, ItsiError>;
5
5
 
6
- #[derive(Error, Debug)]
6
+ #[derive(Error, Debug, Clone)]
7
7
  pub enum ItsiError {
8
8
  #[error("Invalid input {0}")]
9
9
  InvalidInput(String),