pub struct Container<'a> { /* private fields */ }Expand description
A Docker container
Implementations§
Source§impl<'a> Container<'a>
impl<'a> Container<'a>
Sourcepub fn new<T>(connection: &'a Docker, image: T) -> Self
pub fn new<T>(connection: &'a Docker, image: T) -> Self
Create a new Container
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// We can now start our container
container.start(true).await?;
Ok(())
}Sourcepub async fn from_id<T>(connection: &'a Docker, id: T) -> Result<Self, Error>
pub async fn from_id<T>(connection: &'a Docker, id: T) -> Result<Self, Error>
Attempt to fetch an existing container by its ID
§Errors
- Docker inspect fails
- The container isn’t found
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// We can now start our container and grab its id
container.start(false).await?;
let id = container.id().unwrap();
let container2 = Container::from_id(&connection, id).await?;
assert_eq!(container.id(), container2.id());
Ok(())
}Sourcepub fn env(
&mut self,
env: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn env( &mut self, env: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Set the environment variables for the container
NOTE: This will override any existing variables.
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
container.env(["FOO=BAR", "BAZ=QUX"]);
// We can now start our container, and the "FOO" and "BAZ" env vars will be set
container.start(true).await?;
Ok(())
}Sourcepub fn cmd(
&mut self,
cmd: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn cmd( &mut self, cmd: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Set the command to run
The command is provided as a list of strings.
NOTE: This will override any existing command
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
container.cmd(["echo", "Hello!"]);
// We can now start our container, and the command "echo Hello!" will run
container.start(true).await?;
Ok(())
}Sourcepub fn binds(
&mut self,
binds: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn binds( &mut self, binds: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Set a list of volume binds
These binds are in the standard host:dest[:options] format. For more information, see
the Docker documentation.
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// Mount './my-host-dir' at '/some/container/dir' and make it read-only
container.binds(["./my-host-dir:/some/container/dir:ro"]);
// We can now start our container
container.start(true).await?;
Ok(())
}Sourcepub fn id(&self) -> Option<&str>
pub fn id(&self) -> Option<&str>
Get the container ID if it has been created
This will only have a value if Container::create or Container::start has been
called prior.
Sourcepub async fn create(&mut self) -> Result<(), Error>
pub async fn create(&mut self) -> Result<(), Error>
Attempt to create the container
This will take the following into account:
Be sure to set these before calling this!
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
container.env(["FOO=BAR", "BAZ=QUX"]);
container.cmd(["echo", "Hello!"]);
container.binds(["./host-data:/container-data"]);
// The container is created using the above settings
container.create().await?;
// Now it can be started
container.start(true).await?;
Ok(())
}Sourcepub async fn start(&mut self, wait_for_exit: bool) -> Result<(), Error>
pub async fn start(&mut self, wait_for_exit: bool) -> Result<(), Error>
Attempt to start the container
NOTE: If the container has not yet been created, this will attempt to call Container::create first.
wait_for_exit will wait for the container to exit before returning.
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
container.cmd(["echo", "Hello!"]);
// We can now start our container, and the command "echo Hello!" will run.
let wait_for_exit = true;
container.start(wait_for_exit).await?;
// Since we waited for the container to exit, we don't have to stop it.
// It can now just be removed.
container.remove(None).await?;
Ok(())
}Sourcepub async fn status(&self) -> Result<Option<ContainerStatus>, Error>
pub async fn status(&self) -> Result<Option<ContainerStatus>, Error>
Checks if the container has not exited and is marked as healthy
NOTE: If the container has not yet been created, this will immediately return None.
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
use std::time::Duration;
use tokio::time;
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
container.cmd(["echo", "Hello!"]);
let wait_for_exit = false;
container.start(wait_for_exit).await?;
loop {
let status = container.status().await?.unwrap();
if status.is_active() {
time::sleep(Duration::from_secs(5)).await;
continue;
}
println!("Container exited!");
break;
}
Ok(())
}Sourcepub async fn stop(&mut self) -> Result<(), Error>
pub async fn stop(&mut self) -> Result<(), Error>
Stop a running container
NOTE: It is not an error to call this on a container that has not been started, it will simply do nothing.
§Examples
use gadget_sdk::docker::{connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// Does nothing, the container isn't started
container.stop().await?;
// Stops the running container
container.start(false).await?;
container.stop().await?;
Ok(())
}Sourcepub async fn remove(
self,
options: Option<RemoveContainerOptions>,
) -> Result<(), Error>
pub async fn remove( self, options: Option<RemoveContainerOptions>, ) -> Result<(), Error>
Remove a container
NOTE: To remove a running container, a [RemoveContainerOptions] must be provided
with the force flag set.
See also: bollard::container::RemoveContainerOptions
§Examples
use gadget_sdk::docker::{bollard, connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// Start our container
container.start(false).await?;
let remove_container_options = bollard::container::RemoveContainerOptions {
force: true,
..Default::default()
};
// Kills the container and removes it
container.remove(Some(remove_container_options)).await?;
Ok(())
}Sourcepub async fn wait(&self) -> Result<(), Error>
pub async fn wait(&self) -> Result<(), Error>
Wait for a container to exit
NOTE: It is not an error to call this on a container that has not been started, it will simply do nothing.
§Examples
use gadget_sdk::docker::{bollard, connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// Start our container
container.start(false).await?;
// Once this returns, we know that the container has exited.
container.wait().await?;
Ok(())
}Sourcepub async fn logs(
&self,
logs_options: Option<LogsOptions<String>>,
) -> Option<impl Stream<Item = Result<LogOutput, Error>>>
pub async fn logs( &self, logs_options: Option<LogsOptions<String>>, ) -> Option<impl Stream<Item = Result<LogOutput, Error>>>
Fetch the container log stream
NOTE: It is not an error to call this on a container that has not been started,
it will simply do nothing and return None.
See also:
§Examples
use futures::StreamExt;
use gadget_sdk::docker::{bollard, connect_to_docker, Container};
#[tokio::main]
async fn main() -> Result<(), gadget_sdk::Error> {
let connection = connect_to_docker(None).await?;
let mut container = Container::new(&connection, "rustlang/rust");
// Start our container and wait for it to exit
container.start(true).await?;
// We want to collect logs from stderr
let logs_options = bollard::container::LogsOptions {
stderr: true,
follow: true,
..Default::default()
};
// Get our log stream
let mut logs = container
.logs(Some(logs_options))
.await
.expect("logs should be present");
// Now we want to print anything from stderr
while let Some(Ok(out)) = logs.next().await {
if let bollard::container::LogOutput::StdErr { message } = out {
eprintln!("Uh oh! Something was written to stderr: {:?}", message);
}
}
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Container<'a>
impl<'a> !RefUnwindSafe for Container<'a>
impl<'a> Send for Container<'a>
impl<'a> Sync for Container<'a>
impl<'a> Unpin for Container<'a>
impl<'a> !UnwindSafe for Container<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
Source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
Source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
Source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
Source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
Source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
Source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
Source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
Source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
Source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
Source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
Source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
Source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
Source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
Source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
Source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
Source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
Source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
Source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
Source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
Source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
Source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
Source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.