~kmaasrud/pimalaya-webfinger

54e36cf474b644c18f7b892dc7433d5db414ffe4 — Knut Magnus Aasrud 11 months ago e54e655
feat: add Link type
1 files changed, 18 insertions(+), 0 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +18 -0
@@ 1,6 1,24 @@

mod uri;

use serde::{Deserialize, Serialize};
use std::collections::HashMap;

pub fn add(left: usize, right: usize) -> usize {
    left + right
}
pub use uri::Uri;

#[derive(Debug, Deserialize, PartialEq, Serialize)]
pub struct Link {
    rel: Uri, // or registered relation
    mime_type: Option<String>,
    href: Option<Uri>,
    #[serde(default)]
    titles: HashMap<String, String>,
    #[serde(default)]
    properties: HashMap<Uri, Option<String>>,
}

#[cfg(test)]
mod tests {