mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-25 16:32:42 +01:00
chore(sdk): ran clippy
This commit is contained in:
parent
266ad32dff
commit
7c3654d276
@ -33,7 +33,7 @@ pub struct CacheVolume {
|
||||
}
|
||||
impl CacheVolume {
|
||||
pub async fn id(&self) -> eyre::Result<CacheId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -181,7 +181,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves default arguments for future commands.
|
||||
pub async fn default_args(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("defaultArgs");
|
||||
let query = self.selection.select("defaultArgs");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves a directory at the given path. Mounts are included.
|
||||
@ -196,7 +196,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves entrypoint to be prepended to the arguments of all commands.
|
||||
pub async fn entrypoint(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("entrypoint");
|
||||
let query = self.selection.select("entrypoint");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves the value of the specified environment variable.
|
||||
@ -207,7 +207,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves the list of environment variables passed to commands.
|
||||
pub fn env_variables(&self) -> Vec<EnvVariable> {
|
||||
let mut query = self.selection.select("envVariables");
|
||||
let query = self.selection.select("envVariables");
|
||||
return vec![EnvVariable {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -217,7 +217,7 @@ impl Container {
|
||||
/// Retrieves this container after executing the specified command inside it.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn exec(&self) -> Container {
|
||||
let mut query = self.selection.select("exec");
|
||||
let query = self.selection.select("exec");
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -255,7 +255,7 @@ impl Container {
|
||||
/// Exit code of the last executed command. Zero means success.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn exit_code(&self) -> eyre::Result<isize> {
|
||||
let mut query = self.selection.select("exitCode");
|
||||
let query = self.selection.select("exitCode");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Writes the container as an OCI tarball to the destination file path on the host for the specified platformVariants.
|
||||
@ -309,7 +309,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves this container's root filesystem. Mounts are not included.
|
||||
pub fn fs(&self) -> Directory {
|
||||
let mut query = self.selection.select("fs");
|
||||
let query = self.selection.select("fs");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -318,7 +318,7 @@ impl Container {
|
||||
}
|
||||
/// A unique identifier for this container.
|
||||
pub async fn id(&self) -> eyre::Result<ContainerId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves the value of the specified label.
|
||||
@ -329,7 +329,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves the list of labels passed to container.
|
||||
pub fn labels(&self) -> Vec<Label> {
|
||||
let mut query = self.selection.select("labels");
|
||||
let query = self.selection.select("labels");
|
||||
return vec![Label {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -338,7 +338,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves the list of paths where a directory is mounted.
|
||||
pub async fn mounts(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("mounts");
|
||||
let query = self.selection.select("mounts");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Creates a named sub-pipeline
|
||||
@ -372,7 +372,7 @@ impl Container {
|
||||
}
|
||||
/// The platform this container executes and publishes as.
|
||||
pub async fn platform(&self) -> eyre::Result<Platform> {
|
||||
let mut query = self.selection.select("platform");
|
||||
let query = self.selection.select("platform");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Publishes this container as a new image to the specified address, for the platformVariants, returning a fully qualified ref.
|
||||
@ -402,7 +402,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves this container's root filesystem. Mounts are not included.
|
||||
pub fn rootfs(&self) -> Directory {
|
||||
let mut query = self.selection.select("rootfs");
|
||||
let query = self.selection.select("rootfs");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -412,24 +412,24 @@ impl Container {
|
||||
/// The error stream of the last executed command.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn stderr(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("stderr");
|
||||
let query = self.selection.select("stderr");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The output stream of the last executed command.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn stdout(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("stdout");
|
||||
let query = self.selection.select("stdout");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves the user to be set for all commands.
|
||||
pub async fn user(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("user");
|
||||
let query = self.selection.select("user");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Configures default arguments for future commands.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn with_default_args(&self) -> Container {
|
||||
let mut query = self.selection.select("withDefaultArgs");
|
||||
let query = self.selection.select("withDefaultArgs");
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -859,7 +859,7 @@ impl Container {
|
||||
}
|
||||
/// Retrieves the working directory for all commands.
|
||||
pub async fn workdir(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("workdir");
|
||||
let query = self.selection.select("workdir");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -945,7 +945,7 @@ impl Directory {
|
||||
/// Builds a new Docker container from this directory.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn docker_build(&self) -> Container {
|
||||
let mut query = self.selection.select("dockerBuild");
|
||||
let query = self.selection.select("dockerBuild");
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -977,7 +977,7 @@ impl Directory {
|
||||
/// Returns a list of files and directories at the given path.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub async fn entries(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("entries");
|
||||
let query = self.selection.select("entries");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Returns a list of files and directories at the given path.
|
||||
@ -1010,7 +1010,7 @@ impl Directory {
|
||||
}
|
||||
/// The content-addressed identifier of the directory.
|
||||
pub async fn id(&self) -> eyre::Result<DirectoryId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// load a project's metadata
|
||||
@ -1220,12 +1220,12 @@ pub struct EnvVariable {
|
||||
impl EnvVariable {
|
||||
/// The environment variable name.
|
||||
pub async fn name(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("name");
|
||||
let query = self.selection.select("name");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The environment variable value.
|
||||
pub async fn value(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("value");
|
||||
let query = self.selection.select("value");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1238,7 +1238,7 @@ pub struct File {
|
||||
impl File {
|
||||
/// Retrieves the contents of the file.
|
||||
pub async fn contents(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("contents");
|
||||
let query = self.selection.select("contents");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Writes the file to a file path on the host.
|
||||
@ -1249,12 +1249,12 @@ impl File {
|
||||
}
|
||||
/// Retrieves the content-addressed identifier of the file.
|
||||
pub async fn id(&self) -> eyre::Result<FileId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves a secret referencing the contents of this file.
|
||||
pub fn secret(&self) -> Secret {
|
||||
let mut query = self.selection.select("secret");
|
||||
let query = self.selection.select("secret");
|
||||
return Secret {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1263,7 +1263,7 @@ impl File {
|
||||
}
|
||||
/// Gets the size of the file, in bytes.
|
||||
pub async fn size(&self) -> eyre::Result<isize> {
|
||||
let mut query = self.selection.select("size");
|
||||
let query = self.selection.select("size");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves this file with its created/modified timestamps set to the given time, in seconds from the Unix epoch.
|
||||
@ -1293,13 +1293,13 @@ pub struct GitRefTreeOpts<'a> {
|
||||
impl GitRef {
|
||||
/// The digest of the current value of this ref.
|
||||
pub async fn digest(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("digest");
|
||||
let query = self.selection.select("digest");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The filesystem tree at this ref.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn tree(&self) -> Directory {
|
||||
let mut query = self.selection.select("tree");
|
||||
let query = self.selection.select("tree");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1342,7 +1342,7 @@ impl GitRepository {
|
||||
}
|
||||
/// Lists of branches on the repository.
|
||||
pub async fn branches(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("branches");
|
||||
let query = self.selection.select("branches");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Returns details on one commit.
|
||||
@ -1367,7 +1367,7 @@ impl GitRepository {
|
||||
}
|
||||
/// Lists of tags on the repository.
|
||||
pub async fn tags(&self) -> eyre::Result<Vec<String>> {
|
||||
let mut query = self.selection.select("tags");
|
||||
let query = self.selection.select("tags");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1447,7 +1447,7 @@ impl Host {
|
||||
/// Retrieves the current working directory on the host.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn workdir(&self) -> Directory {
|
||||
let mut query = self.selection.select("workdir");
|
||||
let query = self.selection.select("workdir");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1480,7 +1480,7 @@ pub struct HostVariable {
|
||||
impl HostVariable {
|
||||
/// A secret referencing the value of this variable.
|
||||
pub fn secret(&self) -> Secret {
|
||||
let mut query = self.selection.select("secret");
|
||||
let query = self.selection.select("secret");
|
||||
return Secret {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1489,7 +1489,7 @@ impl HostVariable {
|
||||
}
|
||||
/// The value of this variable.
|
||||
pub async fn value(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("value");
|
||||
let query = self.selection.select("value");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1502,12 +1502,12 @@ pub struct Label {
|
||||
impl Label {
|
||||
/// The label name.
|
||||
pub async fn name(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("name");
|
||||
let query = self.selection.select("name");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The label value.
|
||||
pub async fn value(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("value");
|
||||
let query = self.selection.select("value");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1520,7 +1520,7 @@ pub struct Project {
|
||||
impl Project {
|
||||
/// extensions in this project
|
||||
pub fn extensions(&self) -> Vec<Project> {
|
||||
let mut query = self.selection.select("extensions");
|
||||
let query = self.selection.select("extensions");
|
||||
return vec![Project {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1529,7 +1529,7 @@ impl Project {
|
||||
}
|
||||
/// Code files generated by the SDKs in the project
|
||||
pub fn generated_code(&self) -> Directory {
|
||||
let mut query = self.selection.select("generatedCode");
|
||||
let query = self.selection.select("generatedCode");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1538,22 +1538,22 @@ impl Project {
|
||||
}
|
||||
/// install the project's schema
|
||||
pub async fn install(&self) -> eyre::Result<bool> {
|
||||
let mut query = self.selection.select("install");
|
||||
let query = self.selection.select("install");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// name of the project
|
||||
pub async fn name(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("name");
|
||||
let query = self.selection.select("name");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// schema provided by the project
|
||||
pub async fn schema(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("schema");
|
||||
let query = self.selection.select("schema");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// sdk used to generate code for and/or execute this project
|
||||
pub async fn sdk(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("sdk");
|
||||
let query = self.selection.select("sdk");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1607,7 +1607,7 @@ impl Query {
|
||||
/// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn container(&self) -> Container {
|
||||
let mut query = self.selection.select("container");
|
||||
let query = self.selection.select("container");
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1634,13 +1634,13 @@ impl Query {
|
||||
}
|
||||
/// The default platform of the builder.
|
||||
pub async fn default_platform(&self) -> eyre::Result<Platform> {
|
||||
let mut query = self.selection.select("defaultPlatform");
|
||||
let query = self.selection.select("defaultPlatform");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Load a directory by ID. No argument produces an empty directory.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn directory(&self) -> Directory {
|
||||
let mut query = self.selection.select("directory");
|
||||
let query = self.selection.select("directory");
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1697,7 +1697,7 @@ impl Query {
|
||||
}
|
||||
/// Queries the host environment.
|
||||
pub fn host(&self) -> Host {
|
||||
let mut query = self.selection.select("host");
|
||||
let query = self.selection.select("host");
|
||||
return Host {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1762,7 +1762,7 @@ impl Query {
|
||||
/// Loads a socket by its ID.
|
||||
/// /// # Arguments /// /// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn socket(&self) -> Socket {
|
||||
let mut query = self.selection.select("socket");
|
||||
let query = self.selection.select("socket");
|
||||
return Socket {
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
@ -1792,12 +1792,12 @@ pub struct Secret {
|
||||
impl Secret {
|
||||
/// The identifier for this secret.
|
||||
pub async fn id(&self) -> eyre::Result<SecretId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The value of this secret.
|
||||
pub async fn plaintext(&self) -> eyre::Result<String> {
|
||||
let mut query = self.selection.select("plaintext");
|
||||
let query = self.selection.select("plaintext");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
@ -1810,7 +1810,7 @@ pub struct Socket {
|
||||
impl Socket {
|
||||
/// The content-addressed identifier of the socket.
|
||||
pub async fn id(&self) -> eyre::Result<SocketId> {
|
||||
let mut query = self.selection.select("id");
|
||||
let query = self.selection.select("id");
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user