use std::borrow::Cow;
use crate::{result::ResultComp, structs, types::MessageFormat};
#[diagnostic::on_unimplemented(message = "{Self} does not implement `PutMessage` so it can't be used as an argument for MQI put")]
pub trait PutMessage {
fn render(&self) -> Cow<'_, [u8]>;
fn format(&self) -> MessageFormat;
}
pub type PutParam<'a> = (structs::MQMD, structs::MQPMO<'a>);
#[diagnostic::on_unimplemented(message = "{Self} does not implement `PutOption` so it can't be used as an argument for MQI put")]
pub unsafe trait PutOption<'po> {
fn apply_param(&self, param: &mut PutParam<'po>);
}
pub unsafe trait PutAttr {
fn put_extract<'p, F>(param: &mut PutParam<'p>, mqi: F) -> ResultComp<Self>
where
F: FnOnce(&mut PutParam<'p>) -> ResultComp<()>,
Self: Sized;
}