fp_library/classes/
send_ref_apply_second.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 SendRefApplySecond: 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.",
39 "The type of the value in the second context. Must be `Clone + Send + Sync`."
40 )]
41 #[document_parameters("The first context.", "The second context.")]
43 #[document_returns("A new context containing the value from the second context.")]
45 #[document_examples]
46 fn send_ref_apply_second<'a, A: Send + Sync + 'a, B: Clone + 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, B>) {
63 Self::send_ref_lift2(|_: &A, b: &B| b.clone(), fa, fb)
64 }
65 }
66
67 #[document_type_parameters("The brand type.")]
69 impl<Brand: crate::classes::SendRefLift> SendRefApplySecond 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.",
80 "The type of the value in the second context. Must be `Clone + Send + Sync`."
81 )]
82 #[document_parameters("The first context.", "The second context.")]
84 #[document_returns("A new context containing the value from the second context.")]
86 #[document_examples]
87 pub fn send_ref_apply_second<
101 'a,
102 Brand: SendRefApplySecond,
103 A: Send + Sync + 'a,
104 B: Clone + 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, B>) {
109 Brand::send_ref_apply_second(fa, fb)
110 }
111}
112
113pub use inner::*;