pub enum AttachmentSource {
Inline {
media_type: MediaType,
bytes: Vec<u8>,
},
Stored {
attachment_ref: AttachmentRef,
},
ExternalUrl {
media_type: MediaType,
url: String,
},
ProviderFile {
provider_scope: ProviderFileScope,
id: String,
},
}Expand description
The ownership-explicit attachment source at the LLM/content seam.
Inline bytes are transient and must be normalized to Stored before a
durable effect is emitted. Borrowed sources are never fetched by Lash and
never enter the attachment manifest.
Variants§
Implementations§
Source§impl AttachmentSource
impl AttachmentSource
pub fn inline(media_type: MediaType, bytes: Vec<u8>) -> AttachmentSource
pub fn stored(attachment_ref: AttachmentRef) -> AttachmentSource
pub fn external_url( media_type: MediaType, url: impl Into<String>, ) -> AttachmentSource
pub fn provider_file( provider_scope: ProviderFileScope, id: impl Into<String>, ) -> AttachmentSource
pub fn media_type(&self) -> Option<&MediaType>
pub fn stored_ref(&self) -> Option<&AttachmentRef>
Trait Implementations§
Source§impl Clone for AttachmentSource
impl Clone for AttachmentSource
Source§fn clone(&self) -> AttachmentSource
fn clone(&self) -> AttachmentSource
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 AttachmentSource
impl Debug for AttachmentSource
Source§impl<'de> Deserialize<'de> for AttachmentSource
impl<'de> Deserialize<'de> for AttachmentSource
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AttachmentSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AttachmentSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AttachmentSource
Source§impl From<AttachmentSource> for RemoteAttachmentSource
impl From<AttachmentSource> for RemoteAttachmentSource
Source§fn from(value: AttachmentSource) -> RemoteAttachmentSource
fn from(value: AttachmentSource) -> RemoteAttachmentSource
Converts to this type from the input type.
Source§impl PartialEq for AttachmentSource
impl PartialEq for AttachmentSource
Source§impl Serialize for AttachmentSource
impl Serialize for AttachmentSource
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
impl StructuralPartialEq for AttachmentSource
Source§impl TryFrom<RemoteAttachmentSource> for AttachmentSource
impl TryFrom<RemoteAttachmentSource> for AttachmentSource
Source§type Error = RemoteProtocolError
type Error = RemoteProtocolError
The type returned in the event of a conversion error.
Source§fn try_from(
value: RemoteAttachmentSource,
) -> Result<AttachmentSource, <AttachmentSource as TryFrom<RemoteAttachmentSource>>::Error>
fn try_from( value: RemoteAttachmentSource, ) -> Result<AttachmentSource, <AttachmentSource as TryFrom<RemoteAttachmentSource>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for AttachmentSource
impl RefUnwindSafe for AttachmentSource
impl Send for AttachmentSource
impl Sync for AttachmentSource
impl Unpin for AttachmentSource
impl UnsafeUnpin for AttachmentSource
impl UnwindSafe for AttachmentSource
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.