pub struct OperatorLink { /* private fields */ }Expand description
Operator control routed through core (A2): core sends g4a requests down a node’s control stream and correlates replies. C2 relays the bytes without parsing them.
Wire (inner plaintext): {"op_id": u64, "g4a": <frame>} both ways. Messages without
op_id are node-initiated events and go to the events channel.
Implementations§
Source§impl OperatorLink
impl OperatorLink
Sourcepub fn new(
events: Option<UnboundedSender<G4aMessage>>,
) -> (Self, Receiver<Vec<u8>>)
pub fn new( events: Option<UnboundedSender<G4aMessage>>, ) -> (Self, Receiver<Vec<u8>>)
Returns the link and the outbound queue to hand to DrainConsumer::with_outbound.
Sourcepub async fn request<T: Serialize>(
&self,
frame: &T,
timeout: Duration,
) -> Result<G4aMessage, OperatorError>
pub async fn request<T: Serialize>( &self, frame: &T, timeout: Duration, ) -> Result<G4aMessage, OperatorError>
Send one g4a request (e.g. a RoutedNodeRequest) and wait for its reply.
Sourcepub fn handler(self) -> CoreHandler
pub fn handler(self) -> CoreHandler
Drain handler for the node’s g4a control channel: parses g4a on core only.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OperatorLink
impl RefUnwindSafe for OperatorLink
impl Send for OperatorLink
impl Sync for OperatorLink
impl Unpin for OperatorLink
impl UnsafeUnpin for OperatorLink
impl UnwindSafe for OperatorLink
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