pub struct ActivationStateMachine<A: ActivationAuthProvider> {
pub state: ActivationLineState,
/* private fields */
}Expand description
Per-connection routing activation state machine.
The gateway creates one instance per TCP connection. The state machine processes
RoutingActivationRequest frames and produces RoutingActivationResponse frames. It enforces
the activation line state - only Active connections may carry DiagnosticMessage frames.
Fields§
§state: ActivationLineStateCurrent activation line state for this connection.
Implementations§
Source§impl<A: ActivationAuthProvider> ActivationStateMachine<A>
impl<A: ActivationAuthProvider> ActivationStateMachine<A>
pub fn new( gateway_address: u16, registered_addresses: Vec<u16, 16>, supported_types: Vec<ActivationType, 4>, auth: A, ) -> Self
Sourcepub fn process_request(
&mut self,
req: &RoutingActivationRequest,
) -> RoutingActivationResponse
pub fn process_request( &mut self, req: &RoutingActivationRequest, ) -> RoutingActivationResponse
Processes a RoutingActivationRequest and returns the response to send back to the tester.
Transitions the activation line state based on the outcome. The caller is responsible for encoding the response into a DoIP frame.
Sourcepub fn drop_line(&mut self, reason: ActivationDenialReason)
pub fn drop_line(&mut self, reason: ActivationDenialReason)
Drops the activation line - models ignition off or power loss.
Transitions to Deactivated. The gateway could close the TCP connection after calling
this.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for ActivationStateMachine<A>where
A: Freeze,
impl<A> RefUnwindSafe for ActivationStateMachine<A>where
A: RefUnwindSafe,
impl<A> Send for ActivationStateMachine<A>where
A: Send,
impl<A> Sync for ActivationStateMachine<A>where
A: Sync,
impl<A> Unpin for ActivationStateMachine<A>where
A: Unpin,
impl<A> UnsafeUnpin for ActivationStateMachine<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for ActivationStateMachine<A>where
A: UnwindSafe,
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