pub struct Host {
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 Host
impl Host
Sourcepub fn container_image(&self, name: impl Into<String>) -> Container
pub fn container_image(&self, name: impl Into<String>) -> Container
Sourcepub fn directory(&self, path: impl Into<String>) -> Directory
pub fn directory(&self, path: impl Into<String>) -> Directory
Accesses a directory on the host.
§Arguments
path
- Location of the directory to access (e.g., “.”).opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn directory_opts<'a>(
&self,
path: impl Into<String>,
opts: HostDirectoryOpts<'a>,
) -> Directory
pub fn directory_opts<'a>( &self, path: impl Into<String>, opts: HostDirectoryOpts<'a>, ) -> Directory
Accesses a directory on the host.
§Arguments
path
- Location of the directory to access (e.g., “.”).opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn file(&self, path: impl Into<String>) -> File
pub fn file(&self, path: impl Into<String>) -> File
Accesses a file on the host.
§Arguments
path
- Location of the file to retrieve (e.g., “README.md”).opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File
pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File
Accesses a file on the host.
§Arguments
path
- Location of the file to retrieve (e.g., “README.md”).opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn id(&self) -> Result<HostId, DaggerError>
pub async fn id(&self) -> Result<HostId, DaggerError>
A unique identifier for this Host.
Sourcepub fn service(&self, ports: Vec<PortForward>) -> Service
pub fn service(&self, ports: Vec<PortForward>) -> Service
Creates a service that forwards traffic to a specified address via the host.
§Arguments
ports
- Ports to expose via the service, forwarding through the host network.
If a port’s frontend is unspecified or 0, it defaults to the same as the backend port.
An empty set of ports is not valid; an error will be returned.
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn service_opts<'a>(
&self,
ports: Vec<PortForward>,
opts: HostServiceOpts<'a>,
) -> Service
pub fn service_opts<'a>( &self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>, ) -> Service
Creates a service that forwards traffic to a specified address via the host.
§Arguments
ports
- Ports to expose via the service, forwarding through the host network.
If a port’s frontend is unspecified or 0, it defaults to the same as the backend port.
An empty set of ports is not valid; an error will be returned.
opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn set_secret_file(
&self,
name: impl Into<String>,
path: impl Into<String>,
) -> Secret
pub fn set_secret_file( &self, name: impl Into<String>, path: impl Into<String>, ) -> Secret
Sets a secret given a user-defined name and the file path on the host, and returns the secret. The file is limited to a size of 512000 bytes.
§Arguments
name
- The user defined name for this secret.path
- Location of the file to set as a secret.
Sourcepub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service
pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service
Creates a tunnel that forwards traffic from the host to a service.
§Arguments
service
- Service to send traffic from the tunnel.opt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn tunnel_opts(
&self,
service: impl IntoID<ServiceId>,
opts: HostTunnelOpts,
) -> Service
pub fn tunnel_opts( &self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts, ) -> Service
Creates a tunnel that forwards traffic from the host to a service.
§Arguments
service
- Service to send traffic from the tunnel.opt
- optional argument, see inner type for documentation, use_opts to use