pub struct ArtifactWrite { /* private fields */ }Expand description
Idempotent artifact creation request.
Implementations§
Source§impl ArtifactWrite
impl ArtifactWrite
Sourcepub fn new(
scope: ArtifactScope,
idempotency_key: impl Into<String>,
media_type: impl Into<String>,
bytes: Vec<u8>,
) -> Result<Self, ArtifactError>
pub fn new( scope: ArtifactScope, idempotency_key: impl Into<String>, media_type: impl Into<String>, bytes: Vec<u8>, ) -> Result<Self, ArtifactError>
Creates a validated write request.
§Errors
Returns ArtifactError for blank identities, invalid MIME values, or
empty content.
Sourcepub fn with_expires_at_unix_ms(
self,
expires_at_unix_ms: u64,
) -> Result<Self, ArtifactError>
pub fn with_expires_at_unix_ms( self, expires_at_unix_ms: u64, ) -> Result<Self, ArtifactError>
Sets an absolute retention deadline portable across durable stores.
§Errors
Returns ArtifactError::InvalidInput when the timestamp exceeds the
signed 64-bit millisecond representation shared by SQLite and
PostgreSQL.
Sourcepub const fn scope(&self) -> &ArtifactScope
pub const fn scope(&self) -> &ArtifactScope
Returns the isolation scope.
Sourcepub fn with_name(self, name: impl Into<String>) -> Result<Self, ArtifactError>
pub fn with_name(self, name: impl Into<String>) -> Result<Self, ArtifactError>
Sets a bounded neutral display name.
§Errors
Returns ArtifactError::InvalidInput for a blank, oversized, or
control-character-containing name.
Sourcepub fn idempotency_key(&self) -> &str
pub fn idempotency_key(&self) -> &str
Returns the stable idempotency key.
Sourcepub fn media_type(&self) -> &str
pub fn media_type(&self) -> &str
Returns the trusted MIME type.
Sourcepub const fn expires_at_unix_ms(&self) -> Option<u64>
pub const fn expires_at_unix_ms(&self) -> Option<u64>
Returns the optional retention deadline.
Sourcepub fn matches_immutable_reference(&self, reference: &ArtifactRef) -> bool
pub fn matches_immutable_reference(&self, reference: &ArtifactRef) -> bool
Returns whether a stored reference represents this exact immutable write, excluding only the store-assigned creation time.
Trait Implementations§
Source§impl Clone for ArtifactWrite
impl Clone for ArtifactWrite
Source§fn clone(&self) -> ArtifactWrite
fn clone(&self) -> ArtifactWrite
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 moreAuto Trait Implementations§
impl Freeze for ArtifactWrite
impl RefUnwindSafe for ArtifactWrite
impl Send for ArtifactWrite
impl Sync for ArtifactWrite
impl Unpin for ArtifactWrite
impl UnsafeUnpin for ArtifactWrite
impl UnwindSafe for ArtifactWrite
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