pub struct InfraQueueMessage {
pub id: String,
pub timestamp: u64,
pub sender: String,
pub topic: String,
pub payload: String,
pub retry_count: u8,
pub priority: Option<u8>,
}Expand description
Message envelope for INFRAQUEUE.
LLM usage: payload is typically a JSON string carrying inputs for generation,
embedding, or RAG retrieval. Suggested fields: v (schema version), trace_id,
prompt or query, params (e.g., temperature, top_k), and domain-specific context.
Keep payloads reasonably small; store large artifacts in object storage and reference
them by URL or key.
Fields§
§id: String§timestamp: u64§sender: String§topic: String§payload: String§retry_count: u8§priority: Option<u8>Implementations§
Source§impl InfraQueueMessage
impl InfraQueueMessage
Sourcepub fn new(
sender: impl Into<String>,
topic: impl Into<String>,
payload: impl Into<String>,
) -> Self
pub fn new( sender: impl Into<String>, topic: impl Into<String>, payload: impl Into<String>, ) -> Self
Create a new message with safe defaults and robust timestamp handling.
LLM guidance:
- Use this to wrap a job payload for topics like
rag-search,semantic-search,content-tagging,embeddings,pii-scrubbing, etc. - Payload is a JSON string; include a schema version (e.g.,
v: 1) so you can evolve it. - Keep payloads small; reference large documents via URLs/keys.
- Idempotency: include a trace or business key so your worker can de-duplicate.
Example payloads (stringified JSON):
- RAG search: {“v”:1,“trace_id”:“abc123”,“query”:“how do I rotate haproxy certs?”,“top_k”:5,“filters”:{“env”:“prod”}}
- Generation: {“v”:1,“trace_id”:“abc123”,“prompt”:“Write a changelog entry for…”,“params”:{“temperature”:0.2}}
- Embedding: {“v”:1,“trace_id”:“abc123”,“text”:“The quick brown fox…”,“model”:“text-embedding-3-small”}
Trait Implementations§
Source§impl Clone for InfraQueueMessage
impl Clone for InfraQueueMessage
Source§fn clone(&self) -> InfraQueueMessage
fn clone(&self) -> InfraQueueMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InfraQueueMessage
impl Debug for InfraQueueMessage
Source§impl<'de> Deserialize<'de> for InfraQueueMessage
impl<'de> Deserialize<'de> for InfraQueueMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InfraQueueMessage
impl RefUnwindSafe for InfraQueueMessage
impl Send for InfraQueueMessage
impl Sync for InfraQueueMessage
impl Unpin for InfraQueueMessage
impl UnsafeUnpin for InfraQueueMessage
impl UnwindSafe for InfraQueueMessage
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