pub struct GatewayConfig {
pub listen_addr: String,
pub storage_config: BlockStoreConfig,
pub tls_config: Option<TlsConfig>,
pub compression_config: CompressionConfig,
}Expand description
Gateway server configuration
Fields§
§listen_addr: StringListen address
storage_config: BlockStoreConfigStorage configuration
tls_config: Option<TlsConfig>Optional TLS configuration for HTTPS
compression_config: CompressionConfigCompression configuration
Implementations§
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn production() -> Self
pub fn production() -> Self
Create a production-ready configuration
Features:
- Listens on all interfaces (0.0.0.0:8080)
- Maximum compression enabled (best ratio)
- Larger cache (500MB)
- Optimized for throughput
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a development configuration
Features:
- Listens on localhost only (127.0.0.1:8080)
- Fast compression (minimal CPU usage)
- Smaller cache (50MB)
- Optimized for quick iteration
Sourcepub fn testing() -> Self
pub fn testing() -> Self
Create a testing configuration
Features:
- Listens on localhost with random port (127.0.0.1:0)
- Compression disabled for faster tests
- Minimal cache (10MB)
- In-memory or temporary storage
Sourcepub fn with_listen_addr(self, addr: impl Into<String>) -> Self
pub fn with_listen_addr(self, addr: impl Into<String>) -> Self
Builder: Set the listen address
Sourcepub fn with_storage_path(self, path: impl Into<String>) -> Self
pub fn with_storage_path(self, path: impl Into<String>) -> Self
Builder: Set the storage path
Sourcepub fn with_cache_mb(self, size_mb: usize) -> Self
pub fn with_cache_mb(self, size_mb: usize) -> Self
Builder: Set the cache size in MB
Sourcepub fn with_compression_level(self, level: CompressionLevel) -> Self
pub fn with_compression_level(self, level: CompressionLevel) -> Self
Builder: Set compression level
Sourcepub fn with_full_compression(self) -> Self
pub fn with_full_compression(self) -> Self
Builder: Enable all compression formats
Sourcepub fn without_compression(self) -> Self
pub fn without_compression(self) -> Self
Builder: Disable all compression
Sourcepub fn validate(&self) -> CoreResult<()>
pub fn validate(&self) -> CoreResult<()>
Validate the configuration
Returns an error if the configuration is invalid
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GatewayConfig
impl Debug for GatewayConfig
Auto Trait Implementations§
impl Freeze for GatewayConfig
impl RefUnwindSafe for GatewayConfig
impl Send for GatewayConfig
impl Sync for GatewayConfig
impl Unpin for GatewayConfig
impl UnwindSafe for GatewayConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
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> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.