pub struct Descriptor { /* private fields */ }
Expand description
A descriptor is used to connect to a service.
Implementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn new(
ctx: &Context,
rendezvous: PathBuf,
executable: PathBuf,
factory: HandlerFactory,
) -> Self
pub fn new( ctx: &Context, rendezvous: PathBuf, executable: PathBuf, factory: HandlerFactory, ) -> Self
Create a descriptor given its rendez-vous point, the path to the servers executable file, and a handler factory.
Sourcepub fn rendez_vous(&self) -> &Path
pub fn rendez_vous(&self) -> &Path
Returns the rendez-vous point.
Sourcepub fn connect(&self) -> Result<RpcSystem<Side>>
pub fn connect(&self) -> Result<RpcSystem<Side>>
Connects to a descriptor, starting the server if necessary.
§Panic
This will panic if called outside of the Tokio runtime context. See
See Handle::enter
for more details.
Sourcepub fn connect_with_policy(&self, policy: IPCPolicy) -> Result<RpcSystem<Side>>
pub fn connect_with_policy(&self, policy: IPCPolicy) -> Result<RpcSystem<Side>>
Connects to a descriptor, starting the server if necessary.
This function does not use the context’s IPC policy, but uses the given one.
§Panic
This will panic if called outside of the Tokio runtime context. See
See Handle::enter
for more details.
Sourcepub fn bootstrap(&mut self) -> Result<Option<JoinHandle<Result<()>>>>
pub fn bootstrap(&mut self) -> Result<Option<JoinHandle<Result<()>>>>
Turn this process into a server.
This checks if a server is running. If not, it turns the current process into a server.
This function is for servers trying to start themselves. Normally, servers are started by clients on demand. A client should never call this function.
Trait Implementations§
Source§impl Clone for Descriptor
impl Clone for Descriptor
Source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more