Struct bip_utracker::announce::ClientState [] [src]

pub struct ClientState {
    // some fields omitted
}

Announce state of a client reported to the server.

Methods

impl ClientState
[src]

fn new(bytes_downloaded: i64, bytes_left: i64, bytes_uploaded: i64, event: AnnounceEvent) -> ClientState

Create a new ClientState.

fn from_bytes(bytes: &[u8]) -> IResult<&[u8]ClientState>

Construct the ClientState from the given bytes.

fn write_bytes<W>(&self, writer: W) -> Result<()> where W: Write

Write the ClientState to the given writer.

fn event(&self) -> AnnounceEvent

Event reported by the client.

fn bytes_left(&self) -> i64

Bytes left to be downloaded.

fn bytes_uploaded(&self) -> i64

Bytes already uploaded.

fn bytes_downloaded(&self) -> i64

Bytes already downloaded.

Trait Implementations

impl Clone for ClientState
[src]

fn clone(&self) -> ClientState

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for ClientState
[src]

impl Eq for ClientState
[src]

impl PartialEq for ClientState
[src]

fn eq(&self, __arg_0: &ClientState) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &ClientState) -> bool

This method tests for !=.

impl Debug for ClientState
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.