pub fn connect_with_mutator(
    a: &Arc<Overnet>,
    b: &Arc<Overnet>,
    mutator_ab: Box<dyn FnMut(Vec<u8>) -> Vec<u8>>,
    mutator_ba: Box<dyn FnMut(Vec<u8>) -> Vec<u8>>,
    opt: impl Fn() -> fidl_fuchsia_overnet::SocketLinkOptions,
) -> Result<(), Error> {
    let a = a.clone().connect_as_mesh_controller()?;
    let b = b.clone().connect_as_mesh_controller()?;
    let (a1, a2) = fidl::Socket::create(fidl::SocketOpts::STREAM)?;
    let (b1, b2) = fidl::Socket::create(fidl::SocketOpts::STREAM)?;
    let (arx, atx) = fidl::AsyncSocket::from_socket(a2)?.split();
    let (brx, btx) = fidl::AsyncSocket::from_socket(b1)?.split();
    a.attach_socket_link(a1, opt())?;
    b.attach_socket_link(b2, opt())?;
    spawn(copy_with_mutator(brx, atx, mutator_ab));
    spawn(copy_with_mutator(arx, btx, mutator_ba));
    Ok(())
}
/// Connect two test overnet instances, with mutating functions between the stream socket connecting
/// them - to test recovery mechanisms.
Connect two test overnet instances, with mutating functions between the stream socket connecting
them - to test recovery mechanisms.
Connect two test overnet instances with mutating functions between the stream socket connecting them - to test recovery mechanisms .
pub fn connect_with_mutator(
    a: &Arc<Overnet>,
    b: &Arc<Overnet>,
    mutator_ab: Box<dyn FnMut(Vec<u8>) -> Vec<u8>>,
    mutator_ba: Box<dyn FnMut(Vec<u8>) -> Vec<u8>>,
    opt: impl Fn() -> fidl_fuchsia_overnet::SocketLinkOptions,
) -> Result<(), Error> {
    let a = a.clone().connect_as_mesh_controller()?;
    let b = b.clone().connect_as_mesh_controller()?;
    let (a1, a2) = fidl::Socket::create(fidl::SocketOpts::STREAM)?;
    let (b1, b2) = fidl::Socket::create(fidl::SocketOpts::STREAM)?;
    let (arx, atx) = fidl::AsyncSocket::from_socket(a2)?.split();
    let (brx, btx) = fidl::AsyncSocket::from_socket(b1)?.split();
    a.attach_socket_link(a1, opt())?;
    b.attach_socket_link(b2, opt())?;
    spawn(copy_with_mutator(brx, atx, mutator_ab));
    spawn(copy_with_mutator(arx, btx, mutator_ba));
    Ok(())
}
pub fn connect_with_mutator ( a : & Arc < Overnet > , b : & Arc < Overnet > , mutator_ab : Box < dyn FnMut ( Vec < u8 > ) -> Vec < u8 > > , mutator_ba : Box < dyn FnMut ( Vec < u8 > ) -> Vec < u8 > > , opt : impl Fn ( ) -> fidl_fuchsia_overnet :: SocketLinkOptions , ) -> Result < ( ) , Error > { let a = a . clone ( ) . connect_as_mesh_controller ( ) ? ; let b = b . clone ( ) . connect_as_mesh_controller ( ) ? ; let ( a1 , a2 ) = fidl :: Socket :: create ( fidl :: SocketOpts :: STREAM ) ? ; let ( b1 , b2 ) = fidl :: Socket :: create ( fidl :: SocketOpts :: STREAM ) ? ; let ( arx , atx ) = fidl :: AsyncSocket :: from_socket ( a2 ) ? . split ( ) ; let ( brx , btx ) = fidl :: AsyncSocket :: from_socket ( b1 ) ? . split ( ) ; a . attach_socket_link ( a1 , opt ( ) ) ? ; b . attach_socket_link ( b2 , opt ( ) ) ? ; spawn ( copy_with_mutator ( brx , atx , mutator_ab ) ) ; spawn ( copy_with_mutator ( arx , btx , mutator_ba ) ) ; Ok ( ( ) ) }
Connect two test overnet instances, with mutating functions between the stream socket connecting
them - to test recovery mechanisms.
Connect two test overnet instances with mutating functions between the stream socket connecting them - to test recovery mechanisms .
a
&Arc<Overnet>
b
&Arc<Overnet>
mutator_ab
Box<dyn FnMut(Vec<u8>) -> Vec<u8>>
mutator_ba
Box<dyn FnMut(Vec<u8>) -> Vec<u8>>
opt
impl Fn() -> fidl_fuchsia_overnet::SocketLinkOptions
a
&Arc<Overnet>
b
&Arc<Overnet>
mutator_ab
Box<dyn FnMut(Vec<u8>) -> Vec<u8>>
mutator_ba
Box<dyn FnMut(Vec<u8>) -> Vec<u8>>
opt
impl Fn() -> fidl_fuchsia_overnet::SocketLinkOptions