Function mpstthree::binary::cancel::cancel[][src]

pub fn cancel<T>(s: T)
Expand description

Cancels a session. Always succeeds. If the partner calls recv or close after cancellation, those calls fail.

Example

use mpstthree::binary::cancel::cancel;
use mpstthree::binary::struct_trait::end::End;
use mpstthree::binary::struct_trait::session::Session;
use mpstthree::meshedchannels::MeshedChannels;
use mpstthree::role::a::RoleA;
use mpstthree::role::end::RoleEnd;

let (s, _s_dual) = MeshedChannels::<End, End, RoleEnd, RoleA<RoleEnd>>::new();
cancel(s);