pub struct ServiceConfig {
pub service: String,
pub role: String,
pub rank: u8,
pub version: String,
pub allowlist: Allowlist,
pub frame_limit: usize,
pub takeover_timeout: Duration,
pub handoff_grace: Duration,
pub on_event: Option<Arc<dyn Fn(&ServiceEvent) + Send + Sync>>,
pub known_roles: BTreeMap<String, u8>,
pub endpoint: Option<String>,
}Fields§
§service: String§role: String§rank: u8§version: String§allowlist: Allowlist§frame_limit: usize§takeover_timeout: DurationDeadline for election, endpoint publication, or a higher-ranked takeover.
handoff_grace: DurationHow long the incumbent lets in-flight requests reach a boundary.
on_event: Option<Arc<dyn Fn(&ServiceEvent) + Send + Sync>>§known_roles: BTreeMap<String, u8>Role -> rank for peers that publish a role but no rank (HeardRight’s
service.json and takeover.json). A peer whose rank cannot be
resolved is never taken over from and never obliges a handoff.
endpoint: Option<String>Explicit endpoint (a compatibility convention such as HeardRight’s
<service_dir>/speech.sock); default is crate::endpoint_for.
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
pub fn new( service: &str, role: &str, rank: u8, version: &str, allowlist: Allowlist, ) -> Self
Sourcepub fn with_methods(self, table: &MethodTable) -> Self
pub fn with_methods(self, table: &MethodTable) -> Self
Take the allowlist from a MethodTable, the single source
of method policy.
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceConfig
impl !UnwindSafe for ServiceConfig
impl Freeze for ServiceConfig
impl Send for ServiceConfig
impl Sync for ServiceConfig
impl Unpin for ServiceConfig
impl UnsafeUnpin for ServiceConfig
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