pub trait AuthStrategyBounds:
Send
+ Sync
+ 'static { }Expand description
Marker trait alias for the bounds an owned AuthStrategy-providing
credential type C must satisfy when held inside a long-lived client
(e.g. cipherstash_client::ZeroKMS<C> shared across requests).
- On native targets
Cmust beSend + Sync + 'staticso the client can be carried across tokio task /reqwestworker boundaries. - On
wasm32the runtime is single-threaded and the typical credential backing (a JS callable held by aJsValue) cannot cross threads even in principle, so theSend + Syncrequirement is dropped and only'staticremains.
Implemented via a blanket impl — any type satisfying the per-target
bounds automatically implements AuthStrategyBounds. Callers don’t
implement it directly.
Mirrors the cfg-split already in place on AuthStrategy itself,
one layer up. Wasm consumers (e.g. @cipherstash/protect-ffi on
wasm32-unknown-unknown) can hold a !Send + !Sync credential type
without declaring unsafe impl Send / Sync.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<T: Send + Sync + 'static> AuthStrategyBounds for T
Available on non-WebAssembly only.