pub struct SigningError(/* private fields */);Expand description
Represents an error occurred during a signing operation.
This error can occur when using a Signer to sign content. It may represent a transport error when using a remote API (like the IAM signBlob API) or a parsing/signing error when performing local signing with a service account key.
Applications rarely need to create instances of this error type. The exception might be when testing application code, where the application is mocking a Signer behavior.
§Example
let content = b"content to sign";
match signer.sign(content).await {
Ok(signature) => println!("Signature: {:?}", signature),
Err(e) if e.is_transport() => println!("Transport error: {}", e),
Err(e) => println!("Other error: {}", e),
}Implementations§
Source§impl SigningError
impl SigningError
Sourcepub fn is_transport(&self) -> bool
pub fn is_transport(&self) -> bool
Returns true if the error was caused by a transport problem.
This typically happens when using a remote signer (like the IAM signBlob API) and the network request fails or the service returns a transient error.
Sourcepub fn is_parsing(&self) -> bool
pub fn is_parsing(&self) -> bool
Returns true if the error was caused by a parsing problem.
This typically happens when the signer is using a private key that cannot be parsed or is invalid.
Trait Implementations§
Source§impl Debug for SigningError
impl Debug for SigningError
Source§impl Display for SigningError
impl Display for SigningError
Source§impl Error for SigningError
impl Error for SigningError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for SigningError
impl !RefUnwindSafe for SigningError
impl Send for SigningError
impl Sync for SigningError
impl Unpin for SigningError
impl !UnwindSafe for SigningError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.