pub struct ServerConfig<ServerSpecific> {
pub port: u16,
pub ips: Box<[IpAddr]>,
pub bind_to: Skip,
pub self_check_code: Option<String>,
pub jwt_key: Option<SigningKey>,
pub enc_key: Option<PrivateKey>,
pub admin_key: Option<VerifyingKey>,
pub object_store: Option<ObjectStoreConfig>,
pub version: Option<String>,
extra: ServerSpecific,
}Expand description
Configuration for one server. Derefs to ServerSpecific..
Fields§
§port: u16Port to bind this server to
ips: Box<[IpAddr]>Ip addresses to bind to
bind_to: SkipDeprecated.
self_check_code: Option<String>Random string used by this server to identify itself. Randomly generated if not set. May be set manually when multiple instances of the same server are used.
jwt_key: Option<SigningKey>Key used to sign JSON web tokens generated by this server.
If None, one is generated automatically (which is not suitable for production.)
Generate using cargo run tools generate signing-key.
enc_key: Option<PrivateKey>Each server advertises an elgamal::PublicKey so that shared secrets may be established
with this server, and also encrypted messages may be sent to it.
This key is also used to derive non-permanent secrets, like the the transcryptor’s encryption factor f_H for a hub H.
Generate using cargo run tools generate scalar.
admin_key: Option<VerifyingKey>Key used by admin to sign requests for the admin endpoints.
If None, one is generated automatically and the private key is printed to the log.
object_store: Option<ObjectStoreConfig>If the server needs an object store, use this one.
version: Option<String>What version (if any) to claim this pubhubs binary is running.
Uses crate::servers::version() by default. Should only be used for
troubleshooting/debugging.
extra: ServerSpecificCan be accessed via Deref.
Trait Implementations§
Source§impl<ServerSpecific: Clone> Clone for ServerConfig<ServerSpecific>
impl<ServerSpecific: Clone> Clone for ServerConfig<ServerSpecific>
Source§fn clone(&self) -> ServerConfig<ServerSpecific>
fn clone(&self) -> ServerConfig<ServerSpecific>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ServerSpecific: Debug> Debug for ServerConfig<ServerSpecific>
impl<ServerSpecific: Debug> Debug for ServerConfig<ServerSpecific>
Source§impl<X> Deref for ServerConfig<X>
impl<X> Deref for ServerConfig<X>
Source§impl<X> DerefMut for ServerConfig<X>
impl<X> DerefMut for ServerConfig<X>
Source§impl<'de, ServerSpecific> Deserialize<'de> for ServerConfig<ServerSpecific>where
ServerSpecific: Deserialize<'de>,
impl<'de, ServerSpecific> Deserialize<'de> for ServerConfig<ServerSpecific>where
ServerSpecific: Deserialize<'de>,
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>,
Source§impl<Extra: PrepareConfig<Rc<Extensions>> + GetServerType> PrepareConfig<Rc<Extensions>> for ServerConfig<Extra>
impl<Extra: PrepareConfig<Rc<Extensions>> + GetServerType> PrepareConfig<Rc<Extensions>> for ServerConfig<Extra>
Source§impl<ServerSpecific> Serialize for ServerConfig<ServerSpecific>where
ServerSpecific: Serialize,
impl<ServerSpecific> Serialize for ServerConfig<ServerSpecific>where
ServerSpecific: Serialize,
Source§impl<'a, X> ToSocketAddrs for &'a ServerConfig<X>
impl<'a, X> ToSocketAddrs for &'a ServerConfig<X>
Source§type Iter = Box<dyn Iterator<Item = SocketAddr> + 'a>
type Iter = Box<dyn Iterator<Item = SocketAddr> + 'a>
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
SocketAddrs. Read moreAuto Trait Implementations§
impl<ServerSpecific> Freeze for ServerConfig<ServerSpecific>where
ServerSpecific: Freeze,
impl<ServerSpecific> RefUnwindSafe for ServerConfig<ServerSpecific>where
ServerSpecific: RefUnwindSafe,
impl<ServerSpecific> Send for ServerConfig<ServerSpecific>where
ServerSpecific: Send,
impl<ServerSpecific> Sync for ServerConfig<ServerSpecific>where
ServerSpecific: Sync,
impl<ServerSpecific> Unpin for ServerConfig<ServerSpecific>where
ServerSpecific: Unpin,
impl<ServerSpecific> UnsafeUnpin for ServerConfig<ServerSpecific>where
ServerSpecific: UnsafeUnpin,
impl<ServerSpecific> UnwindSafe for ServerConfig<ServerSpecific>where
ServerSpecific: UnwindSafe,
Blanket Implementations§
Source§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
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
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>
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>
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> PayloadTrait for T
impl<T> PayloadTrait for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
random to avoid conflict with the new gen keyword in Rust 2024.Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
random_rangeRng::random_range.Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Source§impl<R> TryRng for R
impl<R> TryRng for R
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
RngCore to a RngReadAdapter.