pub struct PageServer { /* private fields */ }Expand description
A resolved, BOUND page-server listener plus its real bound address.
Holding this value keeps the port reserved (the socket is already in
LISTEN state, queuing connections at the kernel backlog) until
crate::server::ShellServer::adopt takes ownership of the listener to
run the accept loop — so no other process can claim the port in the window
between resolution and serving.
Implementations§
Source§impl PageServer
impl PageServer
Sourcepub fn resolve(frame: &FrameSection) -> Result<Self, HostError>
pub fn resolve(frame: &FrameSection) -> Result<Self, HostError>
Resolves the page-server listener from the [frame] section.
A stated [frame].bind binds exactly (loud failure if taken); an absent
one prefers PREFERRED_PAGE_PORT and walks forward to the next free,
Fetch-safe port.
§Errors
Returns HostError::PageServerUnavailable when a stated [frame].bind
is already in use, or HostError::NoFreePagePort when the whole
forward walk from the preferred port finds nothing free (practically
impossible; a genuinely exhausted local port space).
Sourcepub const fn local_addr(&self) -> SocketAddr
pub const fn local_addr(&self) -> SocketAddr
The REAL bound page-server address — the one printed on boot and folded into the derived bus origin allow-list.
Sourcepub fn into_listener(self) -> TcpListener
pub fn into_listener(self) -> TcpListener
Consumes the resolved page server, yielding the held listener for the shell server’s accept loop to adopt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageServer
impl RefUnwindSafe for PageServer
impl Send for PageServer
impl Sync for PageServer
impl Unpin for PageServer
impl UnsafeUnpin for PageServer
impl UnwindSafe for PageServer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
T in a tonic::Request