Struct tss2_fapi_rs::ActnCallback
pub struct ActnCallback { /* private fields */ }
Expand description
A callback function that allows the FAPI to notify the application.
It is usually called to announce policy actions.
Registered to a FAPI context via the set_policy_action_callback()
function.
Implementations§
§impl ActnCallback
impl ActnCallback
pub fn new(
actn_fn: impl Fn(ActnCallbackParam<'_>) -> bool + 'static + Send,
) -> Self
pub fn new( actn_fn: impl Fn(ActnCallbackParam<'_>) -> bool + 'static + Send, ) -> Self
Creates a new callback instance.
The supplied actn_fn
will be called whenever a PolicyAction element is encountered during policy evaluation. The purpose and reaction to such an event is application dependent. This function receives a ActnCallbackParam
as parameter.
pub fn with_data<T: 'static + Send>(
actn_fn: impl Fn(ActnCallbackParam<'_>, &T) -> bool + 'static + Send,
extra_data: T,
) -> Self
pub fn with_data<T: 'static + Send>( actn_fn: impl Fn(ActnCallbackParam<'_>, &T) -> bool + 'static + Send, extra_data: T, ) -> Self
Creates a new callback instance with additional data.
The supplied actn_fn
will be called whenever a PolicyAction element is encountered during policy evaluation. The purpose and reaction to such an event is application dependent. This function receives a ActnCallbackParam
as parameter.
The application-defined extra_data
argument will be passed to each invocation of actn_fn
as an additional parameter.