#[non_exhaustive]pub enum MessageVisibility {
Both,
AgentOnly,
UserOnly,
}Expand description
Visibility of a message to agent and user.
Replaces the former (agent_visible: bool, user_visible: bool) pair, which
allowed the semantically invalid (false, false) combination. Every variant
guarantees at least one consumer can see the message.
§Examples
use zeph_llm::provider::MessageVisibility;
let v = MessageVisibility::AgentOnly;
assert!(v.is_agent_visible());
assert!(!v.is_user_visible());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Both
Visible to both the agent (LLM context) and the user (conversation log).
AgentOnly
Visible to the agent only (e.g. compaction summaries, internal context).
UserOnly
Visible to the user only (e.g. compacted originals shown in history).
Implementations§
Source§impl MessageVisibility
impl MessageVisibility
Sourcepub fn is_agent_visible(self) -> bool
pub fn is_agent_visible(self) -> bool
Returns true if this message should be included in the LLM request context.
Sourcepub fn is_user_visible(self) -> bool
pub fn is_user_visible(self) -> bool
Returns true if this message should appear in the user-facing conversation log.
Source§impl MessageVisibility
impl MessageVisibility
Sourcepub fn as_db_str(self) -> &'static str
pub fn as_db_str(self) -> &'static str
Serialize to the SQLite/PostgreSQL text value stored in the visibility column.
Sourcepub fn from_db_str(s: &str) -> Self
pub fn from_db_str(s: &str) -> Self
Deserialize from the SQLite/PostgreSQL text value stored in the visibility column.
Unknown values (e.g. from a future migration) default to Both for safety.
Trait Implementations§
Source§impl Clone for MessageVisibility
impl Clone for MessageVisibility
Source§fn clone(&self) -> MessageVisibility
fn clone(&self) -> MessageVisibility
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MessageVisibility
Source§impl Debug for MessageVisibility
impl Debug for MessageVisibility
Source§impl Default for MessageVisibility
impl Default for MessageVisibility
Source§impl<'de> Deserialize<'de> for MessageVisibility
impl<'de> Deserialize<'de> for MessageVisibility
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>,
impl Eq for MessageVisibility
Source§impl PartialEq for MessageVisibility
impl PartialEq for MessageVisibility
Source§fn eq(&self, other: &MessageVisibility) -> bool
fn eq(&self, other: &MessageVisibility) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MessageVisibility
impl Serialize for MessageVisibility
impl StructuralPartialEq for MessageVisibility
Auto Trait Implementations§
impl Freeze for MessageVisibility
impl RefUnwindSafe for MessageVisibility
impl Send for MessageVisibility
impl Sync for MessageVisibility
impl Unpin for MessageVisibility
impl UnsafeUnpin for MessageVisibility
impl UnwindSafe for MessageVisibility
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.