pub struct Activity { /* private fields */ }Expand description
High-level activity payload exchanged with Greentic hosts.
Implementations§
Source§impl Activity
impl Activity
Sourcepub fn custom(action: impl Into<String>, payload: Value) -> Activity
pub fn custom(action: impl Into<String>, payload: Value) -> Activity
Build a custom activity with a raw payload body.
Sourcepub fn with_tenant(self, tenant: impl Into<String>) -> Activity
pub fn with_tenant(self, tenant: impl Into<String>) -> Activity
Attach a tenant identifier to the activity.
Sourcepub fn with_flow(self, flow_id: impl Into<String>) -> Activity
pub fn with_flow(self, flow_id: impl Into<String>) -> Activity
Target a specific flow identifier.
Sourcepub fn with_flow_type(self, flow_type: impl Into<String>) -> Activity
pub fn with_flow_type(self, flow_type: impl Into<String>) -> Activity
Hint which flow type should handle the activity.
Sourcepub fn with_session(self, session_id: impl Into<String>) -> Activity
pub fn with_session(self, session_id: impl Into<String>) -> Activity
Attach a session identifier used for retries/idempotency.
Sourcepub fn with_provider(self, provider: impl Into<String>) -> Activity
pub fn with_provider(self, provider: impl Into<String>) -> Activity
Attach a provider identifier for telemetry scoping.
Sourcepub fn from_user(self, user: impl Into<String>) -> Activity
pub fn from_user(self, user: impl Into<String>) -> Activity
Attach the originating user for messaging activities.
Sourcepub fn in_channel(self, channel: impl Into<String>) -> Activity
pub fn in_channel(self, channel: impl Into<String>) -> Activity
Attach a channel identifier (chat, room, or queue) for canonical session keys.
Sourcepub fn in_conversation(self, conversation: impl Into<String>) -> Activity
pub fn in_conversation(self, conversation: impl Into<String>) -> Activity
Attach a conversation/thread identifier for canonical session keys.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Return the originating session identifier, if supplied.
Sourcepub fn provider_id(&self) -> Option<&str>
pub fn provider_id(&self) -> Option<&str>
Return the originating provider identifier, if supplied.
Sourcepub fn conversation(&self) -> Option<&str>
pub fn conversation(&self) -> Option<&str>
Return the conversation identifier, if supplied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Activity
impl<'de> Deserialize<'de> for Activity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Activity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Activity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Activity
impl Serialize for Activity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Activity
impl RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl UnwindSafe for Activity
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request