Struct ServerWithNotifier

Source
pub struct ServerWithNotifier<'a, T> { /* private fields */ }

Implementations§

Source§

impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>

Source

pub fn restore(&mut self, saved: SavedState) -> Result<(), RestoreError>

Restores state.

This may be called before or after channels have been offered. After calling this routine, restore_channel should be called for each channel to be restored, possibly interleaved with additional calls to offer or revoke channels.

Once all channels are in the appropriate state, revoke_unclaimed_channels should be called. This will revoke any channels that were in the saved state but were not restored via restore_channel.

Source§

impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>

Source

pub fn restore_channel( &mut self, offer_id: OfferId, open: bool, ) -> Result<(), RestoreError>

Marks a channel as restored.

If this is not called for a channel but vmbus state is restored, then it is assumed that the offer is a fresh one, and the channel will be revoked and reoffered.

Source

pub fn revoke_unclaimed_channels(&mut self)

Revoke and reoffer channels to the guest, depending on their RestoreState. This function should be called after ServerWithNotifier::restore.

Source

pub fn reset(&mut self)

Initiates a state reset and a closing of all channels.

Only one reset is allowed at a time, and no calls to handle_synic_message are allowed during a reset operation.

Source

pub fn offer_channel( &mut self, offer: OfferParamsInternal, ) -> Result<OfferId, OfferError>

Creates a new channel, returning its channel ID.

Source

pub fn revoke_channel(&mut self, offer_id: OfferId)

Revokes a channel by ID.

Source

pub fn open_complete(&mut self, offer_id: OfferId, result: i32)

Completes an open operation with result.

Source

pub fn close_complete(&mut self, offer_id: OfferId)

Completes a channel close operation.

Source

pub fn initiate_contact(&mut self, request: InitiateContactRequest)

Source

pub fn send_tl_connect_result(&mut self, result: HvsockConnectResult)

Sends a message to the guest if an hvsocket connect request failed.

Source

pub fn modify_channel_complete(&mut self, offer_id: OfferId, status: i32)

Complete the ModifyChannel message.

N.B. The guest expects no further interrupts on the old VP at this point. This is guaranteed because notify() handles updating the event port synchronously before, notifying the device/relay, and all types of event port protect their VP settings with locks.

Source

pub fn complete_modify_connection(&mut self, response: ModifyConnectionResponse)

Source

pub fn handle_synic_message( &mut self, message: SynicMessage, ) -> Result<(), ChannelError>

Processes an incoming message from the guest.

Source

pub fn gpadl_create_complete( &mut self, offer_id: OfferId, gpadl_id: GpadlId, status: i32, )

Completes a GPADL creation, accepting it if status >= 0, rejecting it otherwise.

Source

pub fn gpadl_teardown_complete(&mut self, offer_id: OfferId, gpadl_id: GpadlId)

Releases a GPADL that is being torn down.

Trait Implementations§

Source§

impl<T> Drop for ServerWithNotifier<'_, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T: Notifier> Inspect for ServerWithNotifier<'_, T>

Source§

fn inspect(&self, req: Request<'_>)

Inspects the object.

Auto Trait Implementations§

§

impl<'a, T> Freeze for ServerWithNotifier<'a, T>

§

impl<'a, T> RefUnwindSafe for ServerWithNotifier<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for ServerWithNotifier<'a, T>
where T: Send,

§

impl<'a, T> Sync for ServerWithNotifier<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for ServerWithNotifier<'a, T>

§

impl<'a, T> !UnwindSafe for ServerWithNotifier<'a, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more