pub struct ContextIDComponent { /* private fields */ }
Expand description
Top-level API for the context_id component
Implementations§
Source§impl ContextIDComponent
impl ContextIDComponent
Sourcepub fn new(
init_context_id: &str,
creation_timestamp_s: i64,
running_in_test_automation: bool,
callback: Box<dyn ContextIdCallback>,
) -> Self
pub fn new( init_context_id: &str, creation_timestamp_s: i64, running_in_test_automation: bool, callback: Box<dyn ContextIdCallback>, ) -> Self
Construct a new ContextIDComponent.
If no creation timestamp is provided, the current time will be used.
Sourcepub fn request(&self, rotation_days_in_s: u8) -> ApiResult<String>
pub fn request(&self, rotation_days_in_s: u8) -> ApiResult<String>
Return the current context ID string.
Sourcepub fn force_rotation(&self) -> ApiResult<()>
pub fn force_rotation(&self) -> ApiResult<()>
Regenerate the context ID.
Sourcepub fn unset_callback(&self) -> ApiResult<()>
pub fn unset_callback(&self) -> ApiResult<()>
Unset the callbacks set during construction, and use a default no-op ContextIdCallback instead.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for ContextIDComponent
impl<UT> LiftRef<UT> for ContextIDComponent
type LiftType = Arc<ContextIDComponent>
Source§impl<UT> LowerError<UT> for ContextIDComponent
impl<UT> LowerError<UT> for ContextIDComponent
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for ContextIDComponent
impl<UT> LowerReturn<UT> for ContextIDComponent
Source§type ReturnType = <Arc<ContextIDComponent> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<ContextIDComponent> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for ContextIDComponent
impl<UT> TypeId<UT> for ContextIDComponent
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for ContextIDComponent
impl !RefUnwindSafe for ContextIDComponent
impl Send for ContextIDComponent
impl Sync for ContextIDComponent
impl Unpin for ContextIDComponent
impl !UnwindSafe for ContextIDComponent
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more