Struct dagger_sdk::File
source · pub struct File {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<Child>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl File
impl File
sourcepub async fn contents(&self) -> Result<String, DaggerError>
pub async fn contents(&self) -> Result<String, DaggerError>
Retrieves the contents of the file.
sourcepub async fn export(&self, path: impl Into<String>) -> Result<bool, DaggerError>
pub async fn export(&self, path: impl Into<String>) -> Result<bool, DaggerError>
Writes the file to a file path on the host.
Arguments
path- Location of the written directory (e.g., “output.txt”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn export_opts(
&self,
path: impl Into<String>,
opts: FileExportOpts
) -> Result<bool, DaggerError>
pub async fn export_opts( &self, path: impl Into<String>, opts: FileExportOpts ) -> Result<bool, DaggerError>
Writes the file to a file path on the host.
Arguments
path- Location of the written directory (e.g., “output.txt”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn id(&self) -> Result<FileId, DaggerError>
pub async fn id(&self) -> Result<FileId, DaggerError>
Retrieves the content-addressed identifier of the file.
sourcepub async fn size(&self) -> Result<isize, DaggerError>
pub async fn size(&self) -> Result<isize, DaggerError>
Gets the size of the file, in bytes.
sourcepub async fn sync(&self) -> Result<FileId, DaggerError>
pub async fn sync(&self) -> Result<FileId, DaggerError>
Force evaluation in the engine.
sourcepub fn with_timestamps(&self, timestamp: isize) -> File
pub fn with_timestamps(&self, timestamp: isize) -> File
Retrieves this file with its created/modified timestamps set to the given time.
Arguments
timestamp- Timestamp to set dir/files in.
Formatted in seconds following Unix epoch (e.g., 1672531199).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl !UnwindSafe for File
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