Skip to content

Commit b3a619c

Browse files
committed
mctp-linux: Add async constructors from MctpAddr
Signed-off-by: Matt Johnston <[email protected]>
1 parent 980c966 commit b3a619c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mctp-linux/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,4 +797,17 @@ impl MctpAddr {
797797
pub fn create_listener(&self, typ: MsgType) -> Result<MctpLinuxListener> {
798798
MctpLinuxListener::new(typ, self.net)
799799
}
800+
801+
/// Create an `MctpLinuxAsyncReq` using the net & eid values in this address.
802+
pub fn create_req_async(&self) -> Result<MctpLinuxAsyncReq> {
803+
MctpLinuxAsyncReq::new(self.eid, self.net)
804+
}
805+
806+
/// Create an `MctpLinuxAsyncListener`.
807+
pub fn create_listener_async(
808+
&self,
809+
typ: MsgType,
810+
) -> Result<MctpLinuxAsyncListener> {
811+
MctpLinuxAsyncListener::new(typ, self.net)
812+
}
800813
}

0 commit comments

Comments
 (0)