Enum cedar_policy::frontend::utils::InterfaceResult
source · pub enum InterfaceResult {
Success {
result: String,
},
Failure {
is_internal: bool,
errors: Vec<String>,
},
}
Expand description
Result of a call to a JSON interface
Variants§
Success
The call succeeded
Failure
The call failed
Fields
§
is_internal: bool
Whether the failure is “internal”.
An “internal failure” is returned when there is a fault in the Cedar Rust code, or when there is a problem with the request in the parts which the Java library is responsible for (e.g. an unsupported operation).
By contrast, a “bad request” is returned when there is an issue in the part of the request supplied by the ultimate user of the library, e.g. a syntax error in a policy.
Implementations§
source§impl InterfaceResult
impl InterfaceResult
sourcepub fn fail_internally(message: String) -> Self
pub fn fail_internally(message: String) -> Self
An “internal failure” result; see docs on InterfaceResult::Failure
sourcepub fn fail_bad_request(errors: Vec<String>) -> Self
pub fn fail_bad_request(errors: Vec<String>) -> Self
A failure result that isn’t internal; see docs on
InterfaceResult::Failure
Trait Implementations§
source§impl Debug for InterfaceResult
impl Debug for InterfaceResult
source§impl<'de> Deserialize<'de> for InterfaceResult
impl<'de> Deserialize<'de> for InterfaceResult
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InterfaceResult
impl RefUnwindSafe for InterfaceResult
impl Send for InterfaceResult
impl Sync for InterfaceResult
impl Unpin for InterfaceResult
impl UnwindSafe for InterfaceResult
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more