pub struct ServerConfig {
pub port: u16,
pub uds_path: Option<PathBuf>,
}Expand description
Configuration for a gRPC server.
Fields§
§port: u16Port to listen on (TCP mode).
uds_path: Option<PathBuf>Unix domain socket path (UDS mode).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_env(default_port: u16) -> Self
pub fn from_env(default_port: u16) -> Self
Create config from environment variables.
UDS mode (standalone):
UDS_BASE_PATH: Base directory for UDS socketsSERVICE_NAME: Service name (e.g., “business”)DOMAIN: Domain name (e.g., “player”) => Socket path:{UDS_BASE_PATH}/{SERVICE_NAME}-{DOMAIN}.sock
TCP mode (distributed):
PORTorGRPC_PORT: TCP port (default:default_port)
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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> 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> 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