IntoDocument

Trait IntoDocument 

Source
pub trait IntoDocument {
    // Required method
    fn write_to(self, c: &mut DocumentConstructor) -> Result<(), WriteError>;
}
Expand description

Trait for writing Rust types to Eure documents.

Types implementing this trait can be serialized into EureDocument via DocumentConstructor.

§Examples

impl IntoDocument for User {
    fn write_to(self, c: &mut DocumentConstructor) -> Result<(), WriteError> {
        c.record(|rec| {
            rec.field("name", self.name)?;
            rec.field_optional("age", self.age)?;
            Ok(())
        })
    }
}

Required Methods§

Source

fn write_to(self, c: &mut DocumentConstructor) -> Result<(), WriteError>

Write this value to the current node in the document constructor.

Implementations on Foreign Types§

Source§

impl IntoDocument for &str

Source§

impl IntoDocument for bool

Source§

impl IntoDocument for f32

Source§

impl IntoDocument for f64

Source§

impl IntoDocument for i32

Source§

impl IntoDocument for i64

Source§

impl IntoDocument for u32

Source§

impl IntoDocument for u64

Source§

impl IntoDocument for usize

Source§

impl IntoDocument for String

Source§

impl IntoDocument for BigInt

Source§

impl<A: IntoDocument> IntoDocument for (A,)

Source§

impl<A: IntoDocument, B: IntoDocument> IntoDocument for (A, B)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument> IntoDocument for (A, B, C)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument> IntoDocument for (A, B, C, D)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument> IntoDocument for (A, B, C, D, E)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument> IntoDocument for (A, B, C, D, E, F)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument> IntoDocument for (A, B, C, D, E, F, G)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument, L: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument, L: IntoDocument, M: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument, L: IntoDocument, M: IntoDocument, N: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument, L: IntoDocument, M: IntoDocument, N: IntoDocument, O: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

impl<A: IntoDocument, B: IntoDocument, C: IntoDocument, D: IntoDocument, E: IntoDocument, F: IntoDocument, G: IntoDocument, H: IntoDocument, I: IntoDocument, J: IntoDocument, K: IntoDocument, L: IntoDocument, M: IntoDocument, N: IntoDocument, O: IntoDocument, P: IntoDocument> IntoDocument for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

impl<T: IntoDocument> IntoDocument for Option<T>

Source§

impl<T: IntoDocument> IntoDocument for Vec<T>

Implementors§