mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
Co-authored-by: Ankit Kumar Gupta <ankit.gupta.001@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Gaurav Rawat <104276743+GauravRawat369@users.noreply.github.com>
8 lines
320 B
Rust
8 lines
320 B
Rust
/// Trait for converting from one foreign type to another
|
|
pub trait ForeignTryFrom<F>: Sized {
|
|
/// Custom error for conversion failure
|
|
type Error;
|
|
/// Convert from a foreign type to the current type and return an error if the conversion fails
|
|
fn foreign_try_from(from: F) -> Result<Self, Self::Error>;
|
|
}
|