#[derive(InterStruct)]
{
    // Attributes available to this derive:
    #[merge]
    #[merge_ref]
    #[into]
    #[into_default]
}
Expand description

Implement various InterStruct traits on this struct.

struct.rs

use inter_struct::prelude::*;

pub struct Target {
    pub test: String,
}

pub struct OtherTarget {
    pub test: String,
}

#[derive(InterStruct)]
#[merge_ref(["crate::structs::Target", "crate:structs::OtherTarget"])]
#[merge("crate::structs::YetAnotherTarget")]
pub struct Test {
    pub test: String,
}

A target struct’s paths has to be

  • contained in this crate.
  • relative to the current crate.

Eiter a single path or a list of paths can be specified. The traits will then be implemented for each given target struct.