Skip to content

Commit

Permalink
Allow Server to be initialized unsafely with nothing (as it is just a…
Browse files Browse the repository at this point in the history
… bunch of MaybeUninit buffers)
  • Loading branch information
ivmarkov committed Jul 8, 2024
1 parent 19efdf8 commit ab30471
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion edge-http/src/io/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,14 @@ where
pub type DefaultServer =
Server<{ DEFAULT_HANDLER_TASKS_COUNT }, { DEFAULT_BUF_SIZE }, { DEFAULT_MAX_HEADERS_COUNT }>;

pub type ServerBuffers<const P: usize, const B: usize> = MaybeUninit<[[u8; B]; P]>;

#[repr(transparent)]
pub struct Server<
const P: usize = DEFAULT_HANDLER_TASKS_COUNT,
const B: usize = DEFAULT_BUF_SIZE,
const N: usize = DEFAULT_MAX_HEADERS_COUNT,
>(MaybeUninit<[[u8; B]; P]>);
>(ServerBuffers<P, B>);

impl<const P: usize, const B: usize, const N: usize> Server<P, B, N> {
#[inline(always)]
Expand Down

0 comments on commit ab30471

Please sign in to comment.