facti-api 0.2.0

Provides tools for interacting with Factorio REST APIs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::borrow::Cow;

pub(crate) trait FormLike {
    fn new() -> Self;

    fn text<T, U>(self, name: T, value: U) -> Self
    where
        T: Into<Cow<'static, str>>,
        U: Into<Cow<'static, str>>;
}

pub(crate) struct FormContainer<T: FormLike>(pub(crate) T);

impl<T: FormLike> FormContainer<T> {
    pub fn into_inner(self) -> T {
        self.0
    }
}