pub struct ComposeService { /* private fields */ }Expand description
Docker Compose service metadata.
Implementations§
Source§impl ComposeService
impl ComposeService
Sourcepub fn new(name: impl AsRef<str>) -> ComposeService
pub fn new(name: impl AsRef<str>) -> ComposeService
Creates a service with trusted static text.
Sourcepub 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.
Sourcepub fn with_image(self, image: impl Into<String>) -> ComposeService
pub fn with_image(self, image: impl Into<String>) -> ComposeService
Adds an image reference string.
Sourcepub fn with_build(self, build: ComposeBuild) -> ComposeService
pub fn with_build(self, build: ComposeBuild) -> ComposeService
Adds build metadata.
Sourcepub fn with_port(self, port: impl Into<String>) -> ComposeService
pub fn with_port(self, port: impl Into<String>) -> ComposeService
Adds a port mapping string.
Sourcepub fn with_volume(self, volume: impl Into<String>) -> ComposeService
pub fn with_volume(self, volume: impl Into<String>) -> ComposeService
Adds a volume string.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub const fn build(&self) -> Option<&ComposeBuild>
pub const fn build(&self) -> Option<&ComposeBuild>
Returns the optional build metadata.
Sourcepub fn environment(&self) -> &[(String, String)]
pub fn environment(&self) -> &[(String, String)]
Returns environment key/value pairs.
Sourcepub fn depends_on(&self) -> &[String]
pub fn depends_on(&self) -> &[String]
Returns dependencies.
Trait Implementations§
Source§impl Clone for ComposeService
impl Clone for ComposeService
Source§fn clone(&self) -> ComposeService
fn clone(&self) -> ComposeService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComposeService
impl Debug for ComposeService
Source§impl PartialEq for ComposeService
impl PartialEq for ComposeService
Source§fn eq(&self, other: &ComposeService) -> bool
fn eq(&self, other: &ComposeService) -> bool
Tests for
self and other values to be equal, and is used by ==.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