cottak 0.1.0

A built in test application for Linux using dynamic libraries in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

use crate::CotConfig;
use crate::message::compose_message;
use crate::SocketConnection;

pub fn push_cot(cot_config: CotConfig, client_address: &str, client_port: u16) {
    // Validate config
    if !cot_config.attachment_paths.is_empty() {
        panic!("Pushing cursor on target messages with attachments requires a file server to serve attachments. Please use `CotServer.push_cot` instead");
    }

    // Compose message
    let message = compose_message(&cot_config, None, None, None).unwrap();

    // Send message
    let mut socket_connection = SocketConnection::new(client_address, client_port);
    socket_connection.send(&message);
}