Skip to main content

UI

Trait UI 

Source
pub trait UI: Send + Sync {
    // Required methods
    fn log(&self, msg: &str);
    fn peer_found(&self, peer: &Peer);
    fn peer_lost(&self, hostname: &str);
    fn show_progress_bar(&self, transfer_id: &str);
    fn update_progress_bar(
        &self,
        transfer_id: &str,
        bytes_sent: u64,
        total_bytes: u64,
    );
    fn file_progress_bar(
        &self,
        transfer_id: &str,
        file_name: &str,
        file_bytes_sent: u64,
        file_total_bytes: u64,
    );
    fn transfert_incoming(
        &self,
        transfer_id: &str,
        sender: &str,
        total_bytes: u64,
        files: Vec<String>,
    );
    fn transfert_refused(&self, transfer_id: &str);
    fn transfert_cancel(&self, transfer_id: &str);
    fn transfert_completed(&self, transfer_id: &str);
    fn transfert_received(
        &self,
        transfer_id: &str,
        peer: &str,
        bytes: u64,
        files: Vec<String>,
    );
    fn transfert_error(&self, transfer_id: &str, error: &ToolError);
}

Required Methods§

Source

fn log(&self, msg: &str)

Source

fn peer_found(&self, peer: &Peer)

Source

fn peer_lost(&self, hostname: &str)

Source

fn show_progress_bar(&self, transfer_id: &str)

Source

fn update_progress_bar( &self, transfer_id: &str, bytes_sent: u64, total_bytes: u64, )

Source

fn file_progress_bar( &self, transfer_id: &str, file_name: &str, file_bytes_sent: u64, file_total_bytes: u64, )

Source

fn transfert_incoming( &self, transfer_id: &str, sender: &str, total_bytes: u64, files: Vec<String>, )

Source

fn transfert_refused(&self, transfer_id: &str)

Source

fn transfert_cancel(&self, transfer_id: &str)

Source

fn transfert_completed(&self, transfer_id: &str)

Source

fn transfert_received( &self, transfer_id: &str, peer: &str, bytes: u64, files: Vec<String>, )

Source

fn transfert_error(&self, transfer_id: &str, error: &ToolError)

Implementors§