pub struct TauriIPCServer {
app_handle: AppHandle,
listeners: Arc<Mutex<HashMap<String, Vec<Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>>>>>,
is_connected: Arc<Mutex<bool>>,
message_queue: Arc<Mutex<Vec<TauriIPCMessage>>>,
}Expand description
Mountain’s IPC Server counterpart to Wind’s TauriIPCServer
Fields§
§app_handle: AppHandle§listeners: Arc<Mutex<HashMap<String, Vec<Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>>>>>§is_connected: Arc<Mutex<bool>>§message_queue: Arc<Mutex<Vec<TauriIPCMessage>>>Implementations§
Source§impl TauriIPCServer
impl TauriIPCServer
Sourcepub async fn initialize(&self) -> Result<(), String>
pub async fn initialize(&self) -> Result<(), String>
Initialize the IPC server and set up event listeners
Sourcepub async fn send(&self, channel: &str, data: Value) -> Result<(), String>
pub async fn send(&self, channel: &str, data: Value) -> Result<(), String>
Send a message to the Wind frontend
Sourcepub fn on(
&self,
channel: &str,
callback: Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>,
) -> Result<(), String>
pub fn on( &self, channel: &str, callback: Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>, ) -> Result<(), String>
Register a listener for incoming messages from Wind
Sourcepub fn off(
&self,
channel: &str,
callback: &Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>,
) -> Result<(), String>
pub fn off( &self, channel: &str, callback: &Box<dyn Fn(Value) -> Result<(), String> + Send + Sync>, ) -> Result<(), String>
Remove a listener
Sourcepub async fn handle_incoming_message(
&self,
message: TauriIPCMessage,
) -> Result<(), String>
pub async fn handle_incoming_message( &self, message: TauriIPCMessage, ) -> Result<(), String>
Handle incoming messages from Wind
Sourceasync fn send_connection_status(&self, connected: bool) -> Result<(), String>
async fn send_connection_status(&self, connected: bool) -> Result<(), String>
Send connection status to Wind
Sourceasync fn emit_message(&self, message: &TauriIPCMessage) -> Result<(), String>
async fn emit_message(&self, message: &TauriIPCMessage) -> Result<(), String>
Emit a message to Wind
Sourceasync fn process_message_queue(&self)
async fn process_message_queue(&self)
Process queued messages
Sourcepub fn get_connection_status(&self) -> Result<bool, String>
pub fn get_connection_status(&self) -> Result<bool, String>
Get connection status
Sourcepub fn get_queue_size(&self) -> Result<usize, String>
pub fn get_queue_size(&self) -> Result<usize, String>
Get queued message count
Sourcepub async fn validate_message_permissions(
&self,
message: &TauriIPCMessage,
) -> Result<(), String>
pub async fn validate_message_permissions( &self, message: &TauriIPCMessage, ) -> Result<(), String>
Advanced: Validate message permissions
Sourcefn create_security_context(&self, message: &TauriIPCMessage) -> SecurityContext
fn create_security_context(&self, message: &TauriIPCMessage) -> SecurityContext
Advanced: Create security context from message
Sourcepub async fn log_security_event(&self, event: SecurityEvent)
pub async fn log_security_event(&self, event: SecurityEvent)
Advanced: Log security event
Sourcepub async fn record_performance_metrics(
&self,
channel: String,
duration: Duration,
success: bool,
)
pub async fn record_performance_metrics( &self, channel: String, duration: Duration, success: bool, )
Advanced: Record performance metrics
Sourcepub async fn get_security_audit_log(
&self,
limit: usize,
) -> Result<Vec<SecurityEvent>, String>
pub async fn get_security_audit_log( &self, limit: usize, ) -> Result<Vec<SecurityEvent>, String>
Advanced: Get security audit log
Sourcepub async fn send_compressed_batch(
&self,
channel: &str,
messages: Vec<TauriIPCMessage>,
) -> Result<(), String>
pub async fn send_compressed_batch( &self, channel: &str, messages: Vec<TauriIPCMessage>, ) -> Result<(), String>
Send compressed message batch
Sourcepub async fn handle_compressed_batch(
&self,
message: TauriIPCMessage,
) -> Result<(), String>
pub async fn handle_compressed_batch( &self, message: TauriIPCMessage, ) -> Result<(), String>
Handle compressed batch message
Sourcepub async fn send_with_pool(
&self,
channel: &str,
data: Value,
) -> Result<(), String>
pub async fn send_with_pool( &self, channel: &str, data: Value, ) -> Result<(), String>
Send message using connection pool
Sourcepub async fn get_connection_stats(&self) -> Result<ConnectionStats, String>
pub async fn get_connection_stats(&self) -> Result<ConnectionStats, String>
Get connection pool statistics
Sourcepub async fn send_secure(
&self,
channel: &str,
data: Value,
) -> Result<(), String>
pub async fn send_secure( &self, channel: &str, data: Value, ) -> Result<(), String>
Send encrypted message
Sourcepub async fn handle_secure_message(
&self,
encrypted_data: Value,
) -> Result<(), String>
pub async fn handle_secure_message( &self, encrypted_data: Value, ) -> Result<(), String>
Handle encrypted message
Sourcepub async fn handle_message_with_permissions(
&self,
message: TauriIPCMessage,
) -> Result<(), String>
pub async fn handle_message_with_permissions( &self, message: TauriIPCMessage, ) -> Result<(), String>
Handle message with permission validation
Trait Implementations§
Source§impl Clone for TauriIPCServer
impl Clone for TauriIPCServer
Source§fn clone(&self) -> TauriIPCServer
fn clone(&self) -> TauriIPCServer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TauriIPCServer
impl !RefUnwindSafe for TauriIPCServer
impl Send for TauriIPCServer
impl Sync for TauriIPCServer
impl Unpin for TauriIPCServer
impl !UnwindSafe for TauriIPCServer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].