[][src]Struct routinator::rrdp::server::Server

pub struct Server { /* fields omitted */ }

The local cache of an RRDP server.

Because values of this type are kept behind arcs, all methods here take imutable selfs and all mutable state is wrapped accordingly.

Methods

impl Server[src]

pub fn existing(notify_uri: Https, server_dir: PathBuf) -> Self[src]

Creates a new server for an existing, not updated server.

Assumes that the server directory exists. Marks the server as not yet updated.

pub fn create(notify_uri: Https, cache_dir: &Path) -> Self[src]

Creates a new server for a given notify URI.

Creates the server’s local directory under cache_dir and leaves it at that. You need to call update to actually fetch the server’s data.

This call will never fail but may leave the server marked as unusable if something goes wrong.

pub fn server_dir(&self) -> &Path[src]

Returns a reference to the server directory.

pub fn update(&self, http: &HttpClient)[src]

Makes sure the server is up-to-date.

If the server already has been updated, does nothing. Otherwise starts an update run.

pub fn notify_uri(&self) -> &Https[src]

Returns a reference to the server’s notify URI.

pub fn is_broken(&self) -> bool[src]

Returns whether the server is broken.

pub fn load_file(&self, uri: &Rsync) -> Result<Option<Bytes>, Error>[src]

Tries to load a file from this server.

This assumes that the server is updated already. If there is no file corresponding to the URI, returns None.

pub fn remove_unused(&self) -> bool[src]

Removes the server’s local cache if it hasn’t been used.

Returns whether it indeed removed the cache.

pub fn metrics(&self) -> Option<RrdpServerMetrics>[src]

Return the server metrics if the server was ever updated.

Trait Implementations

impl Debug for Server[src]

Auto Trait Implementations

impl Send for Server

impl Sync for Server

impl Unpin for Server

impl UnwindSafe for Server

impl RefUnwindSafe for Server

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 = !

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]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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