Skip to content

Commit

Permalink
Make the UDP socket's .with pub
Browse files Browse the repository at this point in the history
This helps develop embassy-rs#2516
out-of-tree.

Not cherry-picked from any PR.
  • Loading branch information
chrysn authored and kaspar030 committed Apr 30, 2024
1 parent d8a376a commit 69f3333
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion embassy-net/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ impl<'a> UdpSocket<'a> {
}
}

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

0 comments on commit 69f3333

Please sign in to comment.