rs-mock-server 0.5.6

A simple, file-based mock API server that maps your directory structure to HTTP routes. Ideal for local development and testing.
use std::fmt::Display;

#[derive(Default)]
pub struct Link {
    pub method: String,
    pub url: String,
}

impl Link {
    pub fn new(method: String, url: String) -> Link {
        Link {
            method,
            url,
        }
    }
}

impl Display for Link {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "<li>{} <a href=\"{}\" target=\"api_mocks\">{}</a></li>", self.method.to_uppercase(), self.url, self.url)
    }
}