Skip to main content

Vine/Server/
mod.rs

1//! # Vine::Server
2//!
3//! Server-side gRPC scaffolding shared by every embedder that hosts a Vine
4//! service: Mountain (`MountainService`), Air (`AirService`), and Rust-side
5//! Cocoon. The pieces below are the boilerplate every bind site needs;
6//! concrete service implementations stay in their owning crate.
7//!
8//! ## Modules
9//!
10//! - [`Constants`] - default ports / timeouts / message-size cap.
11//! - [`ValidateSocketAddress`] - port-and-format pre-flight check.
12//! - [`SpawnBindTask`] - detached `tokio::spawn` that runs
13//!   `Router::serve(Address)` until process termination.
14//! - [`SpawnBindTaskWithShutdown`] - same shape but takes a shutdown future so
15//!   daemons can drain in-flight calls before exit.
16//! - [`Notification`] - one-entry-point-per-file Cocoon → Mountain notification
17//!   handlers dispatched against [`crate::Host::VineHost`].
18//!
19//! ## Embedder call pattern
20//!
21//! ```ignore
22//! use Vine::Server::{Constants, SpawnBindTask, ValidateSocketAddress};
23//!
24//! let Address = ValidateSocketAddress::Fn("[::1]:50051", "MountainService")?;
25//! let Service = MyMountainServiceImpl::new(state);
26//! let Wrapped = MountainServiceServer::new(Service)
27//!     .max_decoding_message_size(Constants::MAX_MESSAGE_SIZE)
28//!     .max_encoding_message_size(Constants::MAX_MESSAGE_SIZE);
29//! let Router  = tonic::transport::Server::builder().add_service(Wrapped);
30//! SpawnBindTask::Fn("MountainService".to_string(), Address, Router);
31//! ```
32
33pub mod Constants;
34
35pub mod Notification;
36
37pub mod SpawnBindTask;
38
39pub mod SpawnBindTaskWithShutdown;
40
41pub mod ValidateSocketAddress;