Convert to a Result.
(&self)
| 400 | |
| 401 | /// Convert to a Result. |
| 402 | pub fn to_result(&self) -> Result<(), IdentityError> { |
| 403 | match self { |
| 404 | VerificationResult::Valid { .. } => Ok(()), |
| 405 | VerificationResult::Invalid { reason } => { |
| 406 | Err(IdentityError::VerificationFailed(reason.clone())) |
| 407 | } |
| 408 | VerificationResult::NotSigned => { |
| 409 | Err(IdentityError::VerificationFailed("Not signed".to_string())) |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | impl fmt::Display for VerificationResult { |