pub trait ErasedSigningPort: Send + Sync {
// Required method
fn erased_sign<'life0, 'async_trait>(
&'life0 self,
input: SigningInput,
) -> Pin<Box<dyn Future<Output = Result<SigningOutput, SigningError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Object-safe version of SigningPort for runtime dispatch.
SigningPort uses native async fn in trait (Rust 2024) and is NOT
object-safe. ErasedSigningPort wraps it via async_trait, producing
Pin<Box<dyn Future>> return types required by Arc<dyn ...>.
A blanket impl<T: SigningPort> ErasedSigningPort for T is provided — you
never need to implement this trait directly.
§Example
use std::sync::Arc;
use stygian_graph::ports::signing::ErasedSigningPort;
use stygian_graph::adapters::signing::NoopSigningAdapter;
let signer: Arc<dyn ErasedSigningPort> = Arc::new(NoopSigningAdapter);Required Methods§
Sourcefn erased_sign<'life0, 'async_trait>(
&'life0 self,
input: SigningInput,
) -> Pin<Box<dyn Future<Output = Result<SigningOutput, SigningError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn erased_sign<'life0, 'async_trait>(
&'life0 self,
input: SigningInput,
) -> Pin<Box<dyn Future<Output = Result<SigningOutput, SigningError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sign an outbound request, returning the authentication material to merge.
§Errors
Returns SigningError if signing fails for any reason.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".