pub struct MysqlServiceConfig {}Expand description
MySQL database service configuration for Docker Compose topology
MySQL is a special service with fixed behavior:
- Never exposes ports externally (security - internal only)
- Always connects to the Database network
Unlike other services, MySQL doesn’t have user-configurable port behavior,
but it still implements PortDerivation for consistency.
§Example
use torrust_tracker_deployer_lib::domain::mysql::MysqlServiceConfig;
use torrust_tracker_deployer_lib::domain::topology::PortDerivation;
let config = MysqlServiceConfig::new();
let ports = config.derive_ports();
assert!(ports.is_empty()); // MySQL never exposes portsImplementations§
Source§impl MysqlServiceConfig
impl MysqlServiceConfig
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new MysqlServiceConfig
§Examples
use torrust_tracker_deployer_lib::domain::mysql::MysqlServiceConfig;
let config = MysqlServiceConfig::new();Sourcepub fn docker_image() -> DockerImage
pub fn docker_image() -> DockerImage
Returns the Docker image used for the MySQL service.
This is a pinned constant — not user-configurable.
§Examples
use torrust_tracker_deployer_lib::domain::mysql::MysqlServiceConfig;
let image = MysqlServiceConfig::docker_image();
assert_eq!(image.full_reference(), "mysql:8.4");Trait Implementations§
Source§impl Clone for MysqlServiceConfig
impl Clone for MysqlServiceConfig
Source§impl Debug for MysqlServiceConfig
impl Debug for MysqlServiceConfig
Source§impl Default for MysqlServiceConfig
impl Default for MysqlServiceConfig
Source§impl<'de> Deserialize<'de> for MysqlServiceConfig
impl<'de> Deserialize<'de> for MysqlServiceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl NetworkDerivation for MysqlServiceConfig
impl NetworkDerivation for MysqlServiceConfig
Source§fn derive_networks(&self, _enabled_services: &EnabledServices) -> Vec<Network>
fn derive_networks(&self, _enabled_services: &EnabledServices) -> Vec<Network>
Derives network assignments for the MySQL service
Implements NET-08: MySQL always connects to Database network only
Source§impl PartialEq for MysqlServiceConfig
impl PartialEq for MysqlServiceConfig
Source§impl PortDerivation for MysqlServiceConfig
impl PortDerivation for MysqlServiceConfig
Source§fn derive_ports(&self) -> Vec<PortBinding>
fn derive_ports(&self) -> Vec<PortBinding>
Derives port bindings for the MySQL database service
Implements PORT-11: MySQL has no exposed ports
MySQL is accessed only via Docker network by the tracker service.
It should never be exposed to the host network for security reasons.
Source§impl Serialize for MysqlServiceConfig
impl Serialize for MysqlServiceConfig
impl StructuralPartialEq for MysqlServiceConfig
Auto Trait Implementations§
impl Freeze for MysqlServiceConfig
impl RefUnwindSafe for MysqlServiceConfig
impl Send for MysqlServiceConfig
impl Sync for MysqlServiceConfig
impl Unpin for MysqlServiceConfig
impl UnsafeUnpin for MysqlServiceConfig
impl UnwindSafe for MysqlServiceConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
T in a tonic::Request