Struct JunoModule

Source
pub struct JunoModule { /* private fields */ }

Implementations§

Source§

impl JunoModule

Source

pub fn default(connection_path: &str) -> Self

Source

pub fn from_unix_socket(socket_path: &str) -> Self

Source

pub fn from_inet_socket(host: &str, port: u16) -> Self

Source

pub fn new(protocol: BaseProtocol, connection: Box<dyn BaseConnection>) -> Self

Source

pub async fn initialize( &mut self, module_id: &str, version: &str, dependencies: HashMap<String, String>, ) -> Result<(), Error>

Source

pub async fn declare_function( &mut self, fn_name: &str, function: fn(HashMap<String, Value>) -> Value, ) -> Result<(), Error>

Source

pub async fn call_function( &mut self, fn_name: &str, args: HashMap<String, Value>, ) -> Result<Value, Error>

Source

pub async fn register_hook( &mut self, hook: &str, callback: fn(Value), ) -> Result<(), Error>

Source

pub async fn trigger_hook(&mut self, hook: &str) -> Result<(), Error>

Source

pub async fn close(&mut self)

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