Skip to main content

KeycloakGuard

Struct KeycloakGuard 

Source
pub struct KeycloakGuard { /* private fields */ }
Expand description

The running guard for a KeycloakContainer.

Implementations§

Source§

impl KeycloakGuard

Source

pub fn admin_username(&self) -> &str

The configured bootstrap admin username (default admin).

Source

pub fn admin_password(&self) -> &str

The configured bootstrap admin password (default admin).

Source

pub fn auth_server_url(&self) -> String

The auth server’s base URI (the HTTP port — realm/OIDC endpoints live under this).

Source

pub fn management_url(&self) -> String

The management interface’s base URI (health/metrics — port 9000, not Self::auth_server_url’s port).

Source

pub async fn stop(self) -> Result<()>

Stops and removes the container, releasing its host ports.

Methods from Deref<Target = ContainerGuard>§

Source

pub fn network(&self) -> Option<&Arc<Network>>

The network this container joined, if any — a module may use this to resolve a sibling’s alias from the guard itself rather than needing to keep a separate Network reference around.

Source

pub fn host(&self) -> &str

The host address published ports are reachable on — always loopback.

Source

pub fn get_mapped_port(&self, guest_port: u16) -> Result<u16, RightsizeError>

The host port guest_port is published on.

Distinguishes two failure causes: if this guard isn’t running (stopped, or never successfully started), the error says so; if it IS running but guest_port was never declared via with_exposed_ports, the error says the port isn’t exposed.

Source

pub async fn logs(&self) -> Result<String, RightsizeError>

The full logs captured so far. Requires the container to be running.

Source

pub async fn exec(&self, cmd: &[&str]) -> Result<ExecResult, RightsizeError>

Runs cmd inside the running container and returns its exit code and captured output.

Source

pub async fn follow_output( &self, consumer: impl Fn(String) + Send + Sync + 'static, ) -> Result<FollowHandle, RightsizeError>

Streams log lines to consumer as they’re produced. Closing (or dropping) the returned crate::backend::FollowHandle halts delivery — no further lines reach consumer afterward, even if the container keeps running.

Source

pub fn is_running(&self) -> bool

True from a successful start() until stop(); false before the first start() and after.

Trait Implementations§

Source§

impl Deref for KeycloakGuard

Source§

type Target = ContainerGuard

The resulting type after dereferencing.
Source§

fn deref(&self) -> &ContainerGuard

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.