[][src]Struct async_tftp::server::TftpServerBuilder

pub struct TftpServerBuilder<H: Handler> { /* fields omitted */ }

TFTP server builder.

Methods

impl TftpServerBuilder<DirRoHandler>[src]

pub fn with_dir_ro<P>(dir: P) -> Result<TftpServerBuilder<DirRoHandler>> where
    P: AsRef<Path>, 
[src]

Create new buidler with DirRoHandler.

impl<H: Handler> TftpServerBuilder<H>[src]

pub fn with_handler(handler: H) -> Self[src]

Create new builder with custom Handler.

pub fn bind(self, addr: SocketAddr) -> Self[src]

Set listening address.

This is ignored if underling socket is set.

Default: 0.0.0.0:69

pub fn socket(self, socket: UdpSocket) -> Self[src]

Set underling UDP socket.

pub fn timeout(self, timeout: Duration) -> Self[src]

Set retry timeout.

Client can override this (RFC2349). If you want to enforce it you must combine it ignore_client_timeout.

This crate allows you to set non-standard timeouts (i.e. timeouts that are less than a second). However if you choose to do it make sure you test it well in your environment since client's behavior is undefined.

Default: 3 seconds

pub fn block_size_limit(self, size: u16) -> Self[src]

Set maximum block size.

Client can request a specific block size (RFC2348). Use this option if you want to set a limit.

Real life scenario: U-Boot does not support IP fragmentation and requests block size of 1468. This works fine if your MTU is 1500 bytes, however if you are accessing client through a VPN, then transfer will never start. Use this option to workaround the problem.

pub fn max_send_retries(self, retries: u32) -> Self[src]

Set maximum send retries for a data block.

On timeout server will try to send the data block again. When retries are reached for the specific data block the server closes the connection with the client.

Default: 100 retries.

pub fn ignore_client_timeout(self) -> Self[src]

Ignore client's timeout option.

With this you enforce server's timeout by ignoring client's timeout option of RFC2349.

pub fn ignore_client_block_size(self) -> Self[src]

Ignore client's block size option.

With this you can ignore client's blksize option of RFC2348. This will enforce 512 block size that is defined in RFC1350.

pub async fn build(__arg0: Self) -> Result<TftpServer<H>>[src]

Build TftpServer.

Auto Trait Implementations

impl<H> Send for TftpServerBuilder<H>

impl<H> Sync for TftpServerBuilder<H> where
    H: Sync

impl<H> Unpin for TftpServerBuilder<H> where
    H: Unpin

impl<H> UnwindSafe for TftpServerBuilder<H> where
    H: UnwindSafe

impl<H> RefUnwindSafe for TftpServerBuilder<H> where
    H: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]