Struct veloren_query_server::server::QueryServer
source · pub struct QueryServer {
addr: SocketAddr,
server_info: Receiver<ServerInfo>,
settings: Settings,
ratelimit: RateLimiter,
}
Fields§
§addr: SocketAddr
§server_info: Receiver<ServerInfo>
§settings: Settings
§ratelimit: RateLimiter
Implementations§
source§impl QueryServer
impl QueryServer
pub fn new( addr: SocketAddr, server_info: Receiver<ServerInfo>, ratelimit: u16, ) -> Self
sourcepub async fn run(&mut self, metrics: Arc<Mutex<Metrics>>) -> Result<(), Error>
pub async fn run(&mut self, metrics: Arc<Mutex<Metrics>>) -> Result<(), Error>
This produces TRACE level logs for any packet received on the assigned port. To prevent potentially unfettered log spam, disable the TRACE level for this crate (when outside of debugging contexts).
NOTE: TRACE and DEBUG levels are disabled by default for this crate when
using veloren-common-frontend
.
fn validate_datagram(data: &[u8]) -> bool
async fn process_datagram( &mut self, datagram: &[u8], remote: SocketAddr, secrets: (u64, u64), metrics: &mut Metrics, socket: &UdpSocket, )
async fn send_response( response: RawQueryServerResponse, addr: SocketAddr, socket: &UdpSocket, metrics: &mut Metrics, )
Auto Trait Implementations§
impl Freeze for QueryServer
impl RefUnwindSafe for QueryServer
impl Send for QueryServer
impl Sync for QueryServer
impl Unpin for QueryServer
impl UnwindSafe for QueryServer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more