pub struct GatewayFile { /* private fields */ }Expand description
A gateway file record: its metadata plus a reference to where its bytes live.
Implementations§
Source§impl GatewayFile
impl GatewayFile
Sourcepub fn new(
id: impl Into<String>,
filename: impl Into<String>,
purpose: impl Into<String>,
bytes: u64,
created_at_ms: u64,
storage_ref: GatewayFileStorageRef,
) -> Self
pub fn new( id: impl Into<String>, filename: impl Into<String>, purpose: impl Into<String>, bytes: u64, created_at_ms: u64, storage_ref: GatewayFileStorageRef, ) -> Self
Creates a file record with the given metadata and storage reference.
Sourcepub fn purpose(&self) -> &str
pub fn purpose(&self) -> &str
Returns the declared purpose of the file (e.g. "batch", "assistants").
Sourcepub fn created_at_ms(&self) -> u64
pub fn created_at_ms(&self) -> u64
Returns the creation timestamp in milliseconds since the Unix epoch.
Sourcepub fn storage_ref(&self) -> &GatewayFileStorageRef
pub fn storage_ref(&self) -> &GatewayFileStorageRef
Returns a reference to where the file’s bytes are stored.
Trait Implementations§
Source§impl Clone for GatewayFile
impl Clone for GatewayFile
Source§fn clone(&self) -> GatewayFile
fn clone(&self) -> GatewayFile
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 GatewayFile
impl Debug for GatewayFile
impl Eq for GatewayFile
Source§impl PartialEq for GatewayFile
impl PartialEq for GatewayFile
Source§fn eq(&self, other: &GatewayFile) -> bool
fn eq(&self, other: &GatewayFile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GatewayFile
Auto Trait Implementations§
impl Freeze for GatewayFile
impl RefUnwindSafe for GatewayFile
impl Send for GatewayFile
impl Sync for GatewayFile
impl Unpin for GatewayFile
impl UnsafeUnpin for GatewayFile
impl UnwindSafe for GatewayFile
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