Struct ComposeService
pub struct ComposeService { /* private fields */ }Expand description
Docker Compose service metadata.
Implementations§
§impl ComposeService
impl ComposeService
pub fn new(name: impl AsRef<str>) -> ComposeService
pub fn new(name: impl AsRef<str>) -> ComposeService
Creates a service with trusted static text.
pub fn try_new(
name: impl AsRef<str>,
) -> Result<ComposeService, ComposeTextError>
pub fn try_new( name: impl AsRef<str>, ) -> Result<ComposeService, ComposeTextError>
Creates a service with validated dynamic text.
pub fn with_image(self, image: impl Into<String>) -> ComposeService
pub fn with_image(self, image: impl Into<String>) -> ComposeService
Adds an image reference string.
pub fn with_build(self, build: ComposeBuild) -> ComposeService
pub fn with_build(self, build: ComposeBuild) -> ComposeService
Adds build metadata.
pub fn with_port(self, port: impl Into<String>) -> ComposeService
pub fn with_port(self, port: impl Into<String>) -> ComposeService
Adds a port mapping string.
pub fn with_volume(self, volume: impl Into<String>) -> ComposeService
pub fn with_volume(self, volume: impl Into<String>) -> ComposeService
Adds a volume string.
pub fn with_environment(
self,
key: impl AsRef<str>,
value: impl Into<String>,
) -> Result<ComposeService, ComposeTextError>
pub fn with_environment( self, key: impl AsRef<str>, value: impl Into<String>, ) -> Result<ComposeService, ComposeTextError>
Adds an environment key/value pair.
pub fn with_dependency(
self,
name: impl AsRef<str>,
) -> Result<ComposeService, ComposeTextError>
pub fn with_dependency( self, name: impl AsRef<str>, ) -> Result<ComposeService, ComposeTextError>
Adds a service dependency.
pub fn with_network(
self,
name: impl AsRef<str>,
) -> Result<ComposeService, ComposeTextError>
pub fn with_network( self, name: impl AsRef<str>, ) -> Result<ComposeService, ComposeTextError>
Adds a named network.
pub fn with_profile(
self,
name: impl AsRef<str>,
) -> Result<ComposeService, ComposeTextError>
pub fn with_profile( self, name: impl AsRef<str>, ) -> Result<ComposeService, ComposeTextError>
Adds a profile.
pub const fn build(&self) -> Option<&ComposeBuild>
pub const fn build(&self) -> Option<&ComposeBuild>
Returns the optional build metadata.
pub fn environment(&self) -> &[(String, String)]
pub fn environment(&self) -> &[(String, String)]
Returns environment key/value pairs.
pub fn depends_on(&self) -> &[String]
pub fn depends_on(&self) -> &[String]
Returns dependencies.
Trait Implementations§
§impl Clone for ComposeService
impl Clone for ComposeService
§fn clone(&self) -> ComposeService
fn clone(&self) -> ComposeService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ComposeService
impl Debug for ComposeService
§impl PartialEq for ComposeService
impl PartialEq for ComposeService
impl Eq for ComposeService
impl StructuralPartialEq for ComposeService
Auto Trait Implementations§
impl Freeze for ComposeService
impl RefUnwindSafe for ComposeService
impl Send for ComposeService
impl Sync for ComposeService
impl Unpin for ComposeService
impl UnsafeUnpin for ComposeService
impl UnwindSafe for ComposeService
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
Mutably borrows from an owned value. Read more