Skip to main content

Container

Trait Container 

Source
pub trait Container: Binding {
    // Required methods
    fn get_internal_url(&self) -> &str;
    fn get_public_url(&self) -> Option<&str>;
    fn get_container_name(&self) -> &str;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A trait for container bindings that enable container-to-container communication

Required Methods§

Source

fn get_internal_url(&self) -> &str

Get the internal URL for container-to-container communication.

This returns the internal service discovery URL that other containers in the same network can use to communicate with this container.

Platform implementations:

  • Horizon (AWS/GCP/Azure): Returns internal DNS URL (e.g., “http://api.svc:8080”)
  • Local (Docker): Returns Docker network DNS URL (e.g., “http://api.svc:3000”)
Source

fn get_public_url(&self) -> Option<&str>

Get the public URL of the container, if available.

Returns the container’s public URL if it exists and is accessible from outside the cluster/network.

Platform implementations:

  • Horizon: Returns load balancer URL if exposed publicly
  • Local: Returns localhost URL with mapped port (e.g., “http://localhost:62844”)
Source

fn get_container_name(&self) -> &str

Get the container name/ID.

Source

fn as_any(&self) -> &dyn Any

Get a reference to this object as Any for dynamic casting

Implementors§