pub struct SidecarLifecycle { /* private fields */ }Expand description
Lifecycle manager owned by BuildahSidecarBackend.
Holds at most one LiveSidecar and lazily produces it on the first
call to Self::ensure. Cheap to clone (the inner Arc shares the
underlying state), so the backend can pass &self references into
async build pipelines without ceremony.
Implementations§
Source§impl SidecarLifecycle
impl SidecarLifecycle
Sourcepub fn new(config: Arc<SidecarConfig>) -> Self
pub fn new(config: Arc<SidecarConfig>) -> Self
Construct a manager bound to config. No filesystem or network
I/O happens here.
Sourcepub async fn ensure(&self) -> Result<LiveSidecar>
pub async fn ensure(&self) -> Result<LiveSidecar>
Return the cached LiveSidecar, spawning + dialing on first
call.
§Errors
Returns whatever the underlying spawn / handshake / dial flow
produced — typically BuildError::NotSupported when the
binary is missing or the handshake times out.
Sourcepub async fn drop_connection(&self)
pub async fn drop_connection(&self)
Drop the cached LiveSidecar so the next call to
Self::ensure performs a fresh spawn + dial. Tears down the
previous child via its Drop impl once the last outstanding
clone is released.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SidecarLifecycle
impl !RefUnwindSafe for SidecarLifecycle
impl !UnwindSafe for SidecarLifecycle
impl Send for SidecarLifecycle
impl Sync for SidecarLifecycle
impl Unpin for SidecarLifecycle
impl UnsafeUnpin for SidecarLifecycle
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request