pub struct ProtocolCore { /* private fields */ }Implementations§
Source§impl ProtocolCore
impl ProtocolCore
pub fn new(node: &str) -> Self
pub fn with_identity(identity: NodeIdentity) -> Self
pub fn with_node(node: NodeCore) -> Self
pub fn node(&self) -> &NodeCore
pub fn handle( &mut self, now: Instant, input: CoreInput, ) -> Result<(), CoreError>
pub fn poll_effect(&mut self) -> Option<CoreEffect>
pub fn session_deadline( &self, session: &SessionId, ) -> Result<Option<Instant>, CoreError>
pub fn session_class( &self, session: &SessionId, ) -> Result<SessionClass, CoreError>
pub fn session_ready(&self, session: &SessionId) -> Result<bool, CoreError>
pub fn relay_peer(&self, stream: &StreamKey) -> Option<&StreamKey>
pub fn open_stream_body( &mut self, session: &SessionId, target_path: &str, kind: Kind, body: Option<BodyId>, hops: Option<u8>, headers: Map<String, Value>, ) -> Result<String, CoreError>
pub fn send_body( &mut self, session: &SessionId, corr: &str, body: Option<BodyId>, ) -> Result<(), CoreError>
pub fn respond_body( &mut self, session: &SessionId, corr: &str, body: Option<BodyId>, headers: Map<String, Value>, ) -> Result<(), CoreError>
pub fn respond_terminal_body( &mut self, session: &SessionId, corr: &str, body: Option<BodyId>, path: Vec<String>, ) -> Result<(), CoreError>
pub fn control( &mut self, session: &SessionId, kind: Kind, payload: Bytes, ) -> Result<(), CoreError>
pub fn fail( &mut self, session: &SessionId, corr: &str, code: ErrorCode, message: &str, ) -> Result<(), CoreError>
pub fn cancel( &mut self, session: &SessionId, corr: &str, ) -> Result<(), CoreError>
Auto Trait Implementations§
impl Freeze for ProtocolCore
impl RefUnwindSafe for ProtocolCore
impl Send for ProtocolCore
impl Sync for ProtocolCore
impl Unpin for ProtocolCore
impl UnsafeUnpin for ProtocolCore
impl UnwindSafe for ProtocolCore
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