pub struct UserFieldTransform(/* private fields */);Expand description
A field callback. Undefined, null, and native object values remain distinct.
Implementations§
Source§impl UserFieldTransform
impl UserFieldTransform
Sourcepub fn new(
callback: impl Fn(Value) -> AuthResult<FieldValue> + Send + Sync + 'static,
) -> Self
pub fn new( callback: impl Fn(Value) -> AuthResult<FieldValue> + Send + Sync + 'static, ) -> Self
Use a synchronous callback at public-input and adapter boundaries.
Sourcepub fn new_async<F, Fut>(callback: F) -> Selfwhere
F: Fn(Value) -> Fut + Send + Sync + 'static,
Fut: Future<Output = AuthResult<FieldValue>> + Send + 'static,
pub fn new_async<F, Fut>(callback: F) -> Selfwhere
F: Fn(Value) -> Fut + Send + Sync + 'static,
Fut: Future<Output = AuthResult<FieldValue>> + Send + 'static,
Await a callback at core, Organization, and supported plugin adapter boundaries. Synchronous public-input parsing rejects async callbacks.
Sourcepub async fn call(&self, value: Value) -> AuthResult<FieldValue>
pub async fn call(&self, value: Value) -> AuthResult<FieldValue>
Invoke a callback and await its result without changing its original error.
Sourcepub fn call_sync(&self, value: Value) -> AuthResult<FieldValue>
pub fn call_sync(&self, value: Value) -> AuthResult<FieldValue>
Invoke a callback at a synchronous policy boundary. Async callbacks return a configuration error before application work starts.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UserFieldTransform
impl !UnwindSafe for UserFieldTransform
impl Freeze for UserFieldTransform
impl Send for UserFieldTransform
impl Sync for UserFieldTransform
impl Unpin for UserFieldTransform
impl UnsafeUnpin for UserFieldTransform
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
Mutably borrows from an owned value. Read more