Proxy

Struct Proxy 

Source
pub struct Proxy {
    pub write: WriteHalf<Box<dyn Transport + Send + Sync + Unpin>>,
    pub request_id: i32,
    pub ident: String,
    pub host: String,
    pub port: i32,
    pub context: Option<HashMap<String, String>>,
    pub handle: Option<JoinHandle<Result<(), Box<dyn Error + Sync + Send>>>>,
    pub message_queue: Arc<Mutex<Vec<MessageType>>>,
    pub stream_type: String,
}

Fields§

§write: WriteHalf<Box<dyn Transport + Send + Sync + Unpin>>§request_id: i32§ident: String§host: String§port: i32§context: Option<HashMap<String, String>>§handle: Option<JoinHandle<Result<(), Box<dyn Error + Sync + Send>>>>§message_queue: Arc<Mutex<Vec<MessageType>>>§stream_type: String

Implementations§

Source§

impl Proxy

Source

pub fn new( stream: Box<dyn Transport + Send + Sync + Unpin>, ident: &str, host: &str, port: i32, context: Option<HashMap<String, String>>, ) -> Proxy

Source

pub async fn ice_context( &mut self, context: HashMap<String, String>, ) -> Result<Proxy, Box<dyn Error + Send + Sync>>

Source

pub async fn dispatch<T: 'static + Debug + Display + FromBytes + Send + Sync>( &mut self, op: &str, mode: u8, params: &Encapsulation, context: Option<HashMap<String, String>>, ) -> Result<ReplyData, Box<dyn Error + Send + Sync>>

Source

pub fn create_request( &mut self, identity_name: &str, operation: &str, mode: u8, params: &Encapsulation, context: Option<HashMap<String, String>>, ) -> RequestData

Source

pub async fn await_validate_connection_message( &mut self, ) -> Result<(), Box<dyn Error + Sync + Send>>

Source

pub async fn await_reply_message( &mut self, request_id: i32, ) -> Result<MessageType, Box<dyn Error + Sync + Send>>

Source

pub async fn make_request<T: 'static + Debug + Display + FromBytes + Send + Sync>( &mut self, request: &RequestData, ) -> Result<ReplyData, Box<dyn Error + Sync + Send>>

Trait Implementations§

Source§

impl Drop for Proxy

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Proxy

§

impl !RefUnwindSafe for Proxy

§

impl Send for Proxy

§

impl Sync for Proxy

§

impl Unpin for Proxy

§

impl !UnwindSafe for Proxy

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, 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.