Skip to content

Commit 6a37d2a

Browse files
chrysnkaspar030
authored andcommitted
Make the UDP socket's .with pub
This helps develop embassy-rs#2516 out-of-tree. Not cherry-picked from any PR.
1 parent d5d52d8 commit 6a37d2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

embassy-net/src/udp.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl<'a> UdpSocket<'a> {
9292
}
9393
}
9494

95-
fn with<R>(&self, f: impl FnOnce(&udp::Socket, &Interface) -> R) -> R {
95+
/// Lock the stack, provide access to the underlying smoltcp UDP socket and interface
96+
pub fn with<R>(&self, f: impl FnOnce(&udp::Socket, &Interface) -> R) -> R {
9697
let s = &*self.stack.borrow();
9798
let socket = s.sockets.get::<udp::Socket>(self.handle);
9899
f(socket, &s.iface)

0 commit comments

Comments
 (0)