Struct dagger_sdk::Host
source · pub struct Host {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl Host
impl Host
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”).
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Host
impl !RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)