pub struct GeneratedService { /* private fields */ }Expand description
A typed generated Compose service definition.
Implementations§
Source§impl GeneratedService
impl GeneratedService
Sourcepub fn set_image(
&mut self,
image: GeneratedString,
) -> Result<(), GenerationError>
pub fn set_image( &mut self, image: GeneratedString, ) -> Result<(), GenerationError>
Sets the service image exactly once.
§Errors
Returns GenerationError::EmptyValue for an empty image or
GenerationError::DuplicateField when already configured.
Sourcepub fn set_command(
&mut self,
command: GeneratedCommand,
) -> Result<(), GenerationError>
pub fn set_command( &mut self, command: GeneratedCommand, ) -> Result<(), GenerationError>
Sets the Compose command form exactly once.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn add_environment(&mut self, environment: GeneratedEnvironment)
pub fn add_environment(&mut self, environment: GeneratedEnvironment)
Adds one ordered environment entry.
Sourcepub fn add_label(
&mut self,
label: GeneratedLabel,
) -> Result<(), GenerationError>
pub fn add_label( &mut self, label: GeneratedLabel, ) -> Result<(), GenerationError>
Adds one uniquely named service metadata label.
§Errors
Returns GenerationError::DuplicateName when the service already defines the label.
Sourcepub fn set_user(&mut self, user: GeneratedString) -> Result<(), GenerationError>
pub fn set_user(&mut self, user: GeneratedString) -> Result<(), GenerationError>
Sets the combined Compose user[:group] value exactly once.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn set_userns_mode(
&mut self,
mode: GeneratedString,
) -> Result<(), GenerationError>
pub fn set_userns_mode( &mut self, mode: GeneratedString, ) -> Result<(), GenerationError>
Sets the user-namespace mode exactly once.
§Errors
Returns GenerationError::EmptyValue for an empty mode or
GenerationError::DuplicateField when already configured.
Sourcepub fn add_supplementary_group(
&mut self,
group: GeneratedString,
) -> Result<(), GenerationError>
pub fn add_supplementary_group( &mut self, group: GeneratedString, ) -> Result<(), GenerationError>
Adds one ordered supplementary group.
§Errors
Returns GenerationError::EmptyValue for an empty group.
Sourcepub fn set_working_dir(
&mut self,
directory: GeneratedString,
) -> Result<(), GenerationError>
pub fn set_working_dir( &mut self, directory: GeneratedString, ) -> Result<(), GenerationError>
Sets the container working directory exactly once.
§Errors
Returns GenerationError::EmptyValue for an empty directory or
GenerationError::DuplicateField when already configured.
Sourcepub fn set_read_only(&mut self, read_only: bool) -> Result<(), GenerationError>
pub fn set_read_only(&mut self, read_only: bool) -> Result<(), GenerationError>
Sets the read-only-root choice exactly once.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn add_extra_host(&mut self, host: GeneratedExtraHost)
pub fn add_extra_host(&mut self, host: GeneratedExtraHost)
Adds one ordered host mapping.
Sourcepub fn add_port(&mut self, port: GeneratedPort)
pub fn add_port(&mut self, port: GeneratedPort)
Adds one ordered published-port declaration.
Sourcepub fn add_mount(&mut self, mount: GeneratedMount)
pub fn add_mount(&mut self, mount: GeneratedMount)
Adds one ordered mount.
Sourcepub fn add_network(
&mut self,
network: GeneratedNetworkAttachment,
) -> Result<(), GenerationError>
pub fn add_network( &mut self, network: GeneratedNetworkAttachment, ) -> Result<(), GenerationError>
Adds one uniquely named network attachment.
§Errors
Returns GenerationError::DuplicateName when the service already uses the network.
Trait Implementations§
Source§impl Clone for GeneratedService
impl Clone for GeneratedService
Source§fn clone(&self) -> GeneratedService
fn clone(&self) -> GeneratedService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more