Function guard::api::v1::mcaptcha::levels::get_levels_util [−][src]
async fn get_levels_util(
name: &str,
data: &Data
) -> Result<Vec<I32Levels>, ServiceError>
diff --git a/guard/api/v1/mcaptcha/levels/fn.get_levels_util.html b/guard/api/v1/mcaptcha/levels/fn.get_levels_util.html index 37c3e0a5..5a489335 100644 --- a/guard/api/v1/mcaptcha/levels/fn.get_levels_util.html +++ b/guard/api/v1/mcaptcha/levels/fn.get_levels_util.html @@ -1,5 +1,5 @@
async fn get_levels_util(
name: &str,
data: &Data
) -> Result<Vec<I32Levels>, ServiceError>
async fn get_levels_util(
name: &str,
data: &Data
) -> Result<Vec<I32Levels>, ServiceError>
AddLevels | |
GetLevels | |
I32Levels | |
Levels | |
add_levels | |
delete_levels | |
get_levels | |
update_levels |
get_levels_util |
pub struct GetLevels { pub token: String, }
token: String
impl<'de> Deserialize<'de> for GetLevels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
-impl Serialize for GetLevels
[src]fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
+ Fieldstoken: String
impl<'de> Deserialize<'de> for GetLevels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
+impl Serialize for GetLevels
[src]impl RefUnwindSafe for GetLevels
[src]impl Send for GetLevels
[src]impl Sync for GetLevels
[src]impl Unpin for GetLevels
[src]impl UnwindSafe for GetLevels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
diff --git a/guard/api/v1/mcaptcha/levels/struct.I32Levels.html b/guard/api/v1/mcaptcha/levels/struct.I32Levels.html index 5f53bf86..17daedb9 100644 --- a/guard/api/v1/mcaptcha/levels/struct.I32Levels.html +++ b/guard/api/v1/mcaptcha/levels/struct.I32Levels.html @@ -1,12 +1,12 @@difficulty_factor: i32
visitor_threshold: i32
impl<'de> Deserialize<'de> for I32Levels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
-impl Serialize for I32Levels
[src]fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
+ Fieldsdifficulty_factor: i32
visitor_threshold: i32
impl<'de> Deserialize<'de> for I32Levels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
+impl Serialize for I32Levels
[src]impl RefUnwindSafe for I32Levels
[src]impl Send for I32Levels
[src]impl Sync for I32Levels
[src]impl Unpin for I32Levels
[src]impl UnwindSafe for I32Levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
diff --git a/guard/api/v1/mcaptcha/levels/struct.Levels.html b/guard/api/v1/mcaptcha/levels/struct.Levels.html index a2de3313..cd9f4212 100644 --- a/guard/api/v1/mcaptcha/levels/struct.Levels.html +++ b/guard/api/v1/mcaptcha/levels/struct.Levels.html @@ -1,11 +1,11 @@pub struct Levels { levels: I32Levels, }
levels: I32Levels
impl<'de> Deserialize<'de> for Levels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
-impl Serialize for Levels
[src]fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
+ Fieldslevels: I32Levels
impl<'de> Deserialize<'de> for Levels
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
+impl Serialize for Levels
[src]impl RefUnwindSafe for Levels
[src]impl Send for Levels
[src]impl Sync for Levels
[src]impl Unpin for Levels
[src]impl UnwindSafe for Levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
diff --git a/guard/api/v1/mcaptcha/levels/struct.add_levels.html b/guard/api/v1/mcaptcha/levels/struct.add_levels.html index 5d3021c0..34c497f1 100644 --- a/guard/api/v1/mcaptcha/levels/struct.add_levels.html +++ b/guard/api/v1/mcaptcha/levels/struct.add_levels.html @@ -1,7 +1,7 @@pub struct add_levels;
impl HttpServiceFactory for add_levels
[src]impl RefUnwindSafe for add_levels
[src]impl Send for add_levels
[src]impl Sync for add_levels
[src]impl Unpin for add_levels
[src]impl UnwindSafe for add_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]pub fn type_id(&self) -> TypeId
[src]Gets the TypeId
of self
. Read more
pub struct add_levels;
impl HttpServiceFactory for add_levels
[src]impl RefUnwindSafe for add_levels
[src]impl Send for add_levels
[src]impl Sync for add_levels
[src]impl Unpin for add_levels
[src]impl UnwindSafe for add_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Conv for T
pub fn conv<T>(self) -> T where
Self: Into<T>,
Converts self
into T
using Into<T>
. Read more
pub struct delete_levels;
impl HttpServiceFactory for delete_levels
[src]impl RefUnwindSafe for delete_levels
[src]impl Send for delete_levels
[src]impl Sync for delete_levels
[src]impl Unpin for delete_levels
[src]impl UnwindSafe for delete_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]pub fn type_id(&self) -> TypeId
[src]Gets the TypeId
of self
. Read more
pub struct delete_levels;
impl HttpServiceFactory for delete_levels
[src]impl RefUnwindSafe for delete_levels
[src]impl Send for delete_levels
[src]impl Sync for delete_levels
[src]impl Unpin for delete_levels
[src]impl UnwindSafe for delete_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Conv for T
pub fn conv<T>(self) -> T where
Self: Into<T>,
Converts self
into T
using Into<T>
. Read more
pub struct get_levels;
impl HttpServiceFactory for get_levels
[src]impl RefUnwindSafe for get_levels
[src]impl Send for get_levels
[src]impl Sync for get_levels
[src]impl Unpin for get_levels
[src]impl UnwindSafe for get_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]pub fn type_id(&self) -> TypeId
[src]Gets the TypeId
of self
. Read more
pub struct get_levels;
impl HttpServiceFactory for get_levels
[src]impl RefUnwindSafe for get_levels
[src]impl Send for get_levels
[src]impl Sync for get_levels
[src]impl Unpin for get_levels
[src]impl UnwindSafe for get_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Conv for T
pub fn conv<T>(self) -> T where
Self: Into<T>,
Converts self
into T
using Into<T>
. Read more
pub struct update_levels;
impl HttpServiceFactory for update_levels
[src]impl RefUnwindSafe for update_levels
[src]impl Send for update_levels
[src]impl Sync for update_levels
[src]impl Unpin for update_levels
[src]impl UnwindSafe for update_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]pub fn type_id(&self) -> TypeId
[src]Gets the TypeId
of self
. Read more
pub struct update_levels;
impl HttpServiceFactory for update_levels
[src]impl RefUnwindSafe for update_levels
[src]impl Send for update_levels
[src]impl Sync for update_levels
[src]impl Unpin for update_levels
[src]impl UnwindSafe for update_levels
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Conv for T
pub fn conv<T>(self) -> T where
Self: Into<T>,
Converts self
into T
using Into<T>
. Read more
pub fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
pub fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]replaced by Error::source, which can support downcasting
-impl From<CaptchaError> for ServiceError
[src]fn from(e: CaptchaError) -> ServiceError
[src]Performs the conversion.
-impl From<CredsError> for ServiceError
[src]fn from(e: CredsError) -> ServiceError
[src]Performs the conversion.
-impl From<Error> for ServiceError
[src]impl From<ParseError> for ServiceError
[src]fn from(_: ParseError) -> ServiceError
[src]Performs the conversion.
-impl From<SendRequestError> for ServiceError
[src]fn from(e: SendRequestError) -> ServiceError
[src]Performs the conversion.
-impl From<ValidationErrors> for ServiceError
[src]fn from(_: ValidationErrors) -> ServiceError
[src]Performs the conversion.
+impl From<CaptchaError> for ServiceError
[src]fn from(e: CaptchaError) -> ServiceError
[src]Performs the conversion.
+impl From<CredsError> for ServiceError
[src]fn from(e: CredsError) -> ServiceError
[src]Performs the conversion.
+impl From<Error> for ServiceError
[src]impl From<ParseError> for ServiceError
[src]fn from(_: ParseError) -> ServiceError
[src]Performs the conversion.
+impl From<SendRequestError> for ServiceError
[src]fn from(e: SendRequestError) -> ServiceError
[src]Performs the conversion.
+impl From<ValidationErrors> for ServiceError
[src]fn from(_: ValidationErrors) -> ServiceError
[src]Performs the conversion.
impl PartialEq<ServiceError> for ServiceError
[src]fn eq(&self, other: &ServiceError) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ServiceError) -> bool
[src]This method tests for !=
.
impl ResponseError for ServiceError
[src]fn error_response(&self) -> HttpResponse
[src]Create response for error Read more
-fn status_code(&self) -> StatusCode
[src]Response's status code Read more
+impl ResponseError for ServiceError
[src]fn error_response(&self) -> HttpResponse
[src]Create response for error Read more
+fn status_code(&self) -> StatusCode
[src]Response's status code Read more
impl StructuralPartialEq for ServiceError
[src]impl RefUnwindSafe for ServiceError
[src]impl Send for ServiceError
[src]impl Sync for ServiceError
[src]impl Unpin for ServiceError
[src]impl UnwindSafe for ServiceError
[src]impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
diff --git a/guard/errors/fn.dup_error.html b/guard/errors/fn.dup_error.html index 5ea5a182..38e3753d 100644 --- a/guard/errors/fn.dup_error.html +++ b/guard/errors/fn.dup_error.html @@ -1,5 +1,5 @@pub fn dup_error(e: Error, dup_error: ServiceError) -> ServiceError
pub fn dup_error(e: Error, dup_error: ServiceError) -> ServiceError
ErrorToResponse |
ServiceError |
dup_error |
type ServiceResult<V> = Result<V, ServiceError>;
type ServiceResult<V> = Result<V, ServiceError>;
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
@@ -358,6 +360,8 @@
pub name: String,
}
+// TODO try for non-existent token names
+
#[post("/api/v1/mcaptcha/domain/token/levels/add")]
pub async fn add_levels(
payload: web::Json<AddLevels>,
diff --git a/src/guard/errors.rs.html b/src/guard/errors.rs.html
index 87549b60..ab07e848 100644
--- a/src/guard/errors.rs.html
+++ b/src/guard/errors.rs.html
@@ -230,7 +230,6 @@
227
228
229
-230
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
@@ -372,7 +371,6 @@
ServiceError::ChallengeVerificationFailure => StatusCode::UNAUTHORIZED,
ServiceError::CaptchaError(e) => match e {
CaptchaError::MailboxError => StatusCode::INTERNAL_SERVER_ERROR,
-
_ => StatusCode::BAD_REQUEST,
},
}