Skip to main content

ForeignConnection

Struct ForeignConnection 

pub struct ForeignConnection {
    pub config: Config,
    /* private fields */
}

Fields§

§config: Config

Implementations§

§

impl ForeignConnection

pub fn prepare( mode: &str, address: Option<String>, id: Option<u8>, peers: Option<Vec<String>>, directory: Option<String>, ) -> Result<Self>

pub fn prepare_with( mode: &str, address: Option<String>, id: Option<u8>, peers: Option<Vec<String>>, directory: Option<String>, flush: Option<String>, metrics: Option<ReplicaMetrics>, ) -> Result<Self>

address is the server’s address in server mode. In replicated mode it is optional and carries only this member’s connection options, as ?cert=PATH&key=PATH&ca=PATH&token-file=PATH (Security::from_options).

pub fn next_call_json(&mut self) -> Result<Option<String>>

pub fn server(addr: &str) -> Result<Self>

May wait for the previous worker to relinquish its lease.

pub fn replica(id: u8, peers: Vec<String>, dir: PathBuf) -> Result<Self>

Every peer runs the protocol while its SDK waits to become primary.

pub fn set_notify(&self, notify: Notify)

pub fn check(&self) -> Result<()>

pub fn next_call(&mut self) -> Option<RelayedCall>

pub fn invocation_state(&self, awaiting: &[String]) -> Option<&'static str>

An invoked worker (crate::invoke): running, idle, expired or lost (see crate::invoke::Progress); None for any other connection. awaiting: workflow types the host has runs of and no code for. Poll every few milliseconds; once it is not running, close the engine and drop this connection, which reports to the server and leaves.

pub fn reply(&self, relay: u64, payload: Vec<u8>) -> Result<()>

Trait Implementations§

§

impl Drop for ForeignConnection

§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.

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> Same for T

Source§

type Output = T

Should always be Self
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.