pub struct File {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
Fields§
§proc: Option<Arc<DaggerSessionProc>>
§selection: Selection
§graphql_client: DynGraphQLClient
Implementations§
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 digest(&self) -> Result<String, DaggerError>
pub async fn digest(&self) -> Result<String, DaggerError>
Return the file’s digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
§Arguments
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn digest_opts(
&self,
opts: FileDigestOpts,
) -> Result<String, DaggerError>
pub async fn digest_opts( &self, opts: FileDigestOpts, ) -> Result<String, DaggerError>
Return the file’s digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
§Arguments
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn export(
&self,
path: impl Into<String>,
) -> Result<String, DaggerError>
pub async fn export( &self, path: impl Into<String>, ) -> Result<String, 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<String, DaggerError>
pub async fn export_opts( &self, path: impl Into<String>, opts: FileExportOpts, ) -> Result<String, 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>
A unique identifier for this File.
Sourcepub async fn name(&self) -> Result<String, DaggerError>
pub async fn name(&self) -> Result<String, DaggerError>
Retrieves the name of the file.
Sourcepub async fn size(&self) -> Result<isize, DaggerError>
pub async fn size(&self) -> Result<isize, DaggerError>
Retrieves 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).