fp_library/classes/
send_ref_apply_first.rs1#[fp_macros::document_module]
21mod inner {
22 use {
23 crate::kinds::*,
24 fp_macros::*,
25 };
26
27 #[kind(type Of<'a, A: 'a>: 'a;)]
32 pub trait SendRefApplyFirst: crate::classes::SendRefLift {
33 #[document_signature]
35 #[document_type_parameters(
37 "The lifetime of the values.",
38 "The type of the value in the first context. Must be `Clone + Send + Sync`.",
39 "The type of the value in the second context."
40 )]
41 #[document_parameters("The first context.", "The second context.")]
43 #[document_returns("A new context containing the value from the first context.")]
45 #[document_examples]
46 fn send_ref_apply_first<'a, A: Clone + Send + Sync + 'a, B: Send + Sync + 'a>(
60 fa: &Apply!(<Self as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>),
61 fb: &Apply!(<Self as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>),
62 ) -> Apply!(<Self as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>) {
63 Self::send_ref_lift2(|a: &A, _: &B| a.clone(), fa, fb)
64 }
65 }
66
67 #[document_type_parameters("The brand type.")]
69 impl<Brand: crate::classes::SendRefLift> SendRefApplyFirst for Brand {}
70
71 #[document_signature]
75 #[document_type_parameters(
77 "The lifetime of the values.",
78 "The brand of the context.",
79 "The type of the value in the first context. Must be `Clone + Send + Sync`.",
80 "The type of the value in the second context."
81 )]
82 #[document_parameters("The first context.", "The second context.")]
84 #[document_returns("A new context containing the value from the first context.")]
86 #[document_examples]
87 pub fn send_ref_apply_first<
101 'a,
102 Brand: SendRefApplyFirst,
103 A: Clone + Send + Sync + 'a,
104 B: Send + Sync + 'a,
105 >(
106 fa: &Apply!(<Brand as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>),
107 fb: &Apply!(<Brand as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>),
108 ) -> Apply!(<Brand as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>) {
109 Brand::send_ref_apply_first(fa, fb)
110 }
111}
112
113pub use inner::*;