pub struct RpcbindClient<IO> { /* private fields */ }Expand description
Client for rpcbind v3/v4 procedures (RFC 1833).
Provides gettime() (version 3) and getstat() (version 4) over
a single TCP connection. Accepts AUTH_NONE, matching the
portmapper convention.
Implementations§
Source§impl<IO> RpcbindClient<IO>
impl<IO> RpcbindClient<IO>
Sourcepub fn new(io: IO) -> Self
pub fn new(io: IO) -> Self
Create a new rpcbind client.
The rpcbind service accepts AUTH_NONE for query procedures, so no credential is set up here.
Sourcepub async fn set(
&mut self,
program: u32,
version: u32,
netid: &str,
addr: &str,
owner: &str,
) -> Result<bool, RpcError>
pub async fn set( &mut self, program: u32, version: u32, netid: &str, addr: &str, owner: &str, ) -> Result<bool, RpcError>
RPCBPROC_SET (proc 1, version 3): register a binding.
Sourcepub async fn unset(
&mut self,
program: u32,
version: u32,
netid: &str,
addr: &str,
owner: &str,
) -> Result<bool, RpcError>
pub async fn unset( &mut self, program: u32, version: u32, netid: &str, addr: &str, owner: &str, ) -> Result<bool, RpcError>
RPCBPROC_UNSET (proc 2, version 3): unregister a binding.
Sourcepub async fn getaddr(
&mut self,
program: u32,
version: u32,
netid: &str,
) -> Result<String, RpcError>
pub async fn getaddr( &mut self, program: u32, version: u32, netid: &str, ) -> Result<String, RpcError>
RPCBPROC_GETADDR (proc 3, version 3): looks up the universal address for a given program, version, and network id.
Sourcepub async fn dump(&mut self) -> Result<Vec<RpcbEntry>, RpcError>
pub async fn dump(&mut self) -> Result<Vec<RpcbEntry>, RpcError>
RPCBPROC_DUMP (proc 4, version 3): list all registered bindings.
Sourcepub async fn callit(
&mut self,
program: u32,
version: u32,
proc: u32,
args: &[u8],
) -> Result<RpcbRmtCallRes, RpcError>
pub async fn callit( &mut self, program: u32, version: u32, proc: u32, args: &[u8], ) -> Result<RpcbRmtCallRes, RpcError>
RPCBPROC_CALLIT (proc 5, version 3): indirect call through rpcbind.
Sourcepub async fn gettime(&mut self) -> Result<u32, RpcError>
pub async fn gettime(&mut self) -> Result<u32, RpcError>
RPCBPROC_GETTIME (proc 6, version 3): returns the server’s local time as seconds since the Unix epoch.
Sourcepub async fn uaddr2taddr(&mut self, uaddr: &str) -> Result<Netbuf, RpcError>
pub async fn uaddr2taddr(&mut self, uaddr: &str) -> Result<Netbuf, RpcError>
RPCBPROC_UADDR2TADDR (proc 7, version 3): convert a universal address to a transport-specific address.
Sourcepub async fn taddr2uaddr(&mut self, taddr: &Netbuf) -> Result<String, RpcError>
pub async fn taddr2uaddr(&mut self, taddr: &Netbuf) -> Result<String, RpcError>
RPCBPROC_TADDR2UADDR (proc 8, version 3): convert a transport-specific address to a universal address.
Sourcepub async fn bcast(
&mut self,
program: u32,
version: u32,
proc: u32,
args: &[u8],
) -> Result<RpcbRmtCallRes, RpcError>
pub async fn bcast( &mut self, program: u32, version: u32, proc: u32, args: &[u8], ) -> Result<RpcbRmtCallRes, RpcError>
RPCBPROC_BCAST (proc 5, version 4): broadcast call through rpcbind.
Same wire format as CALLIT but sent via v4; the server broadcasts the call and returns the first response.
Sourcepub async fn getversaddr(
&mut self,
program: u32,
version: u32,
netid: &str,
) -> Result<String, RpcError>
pub async fn getversaddr( &mut self, program: u32, version: u32, netid: &str, ) -> Result<String, RpcError>
RPCBPROC_GETVERSADDR (proc 9, version 4): like GETADDR but
respects r_vers strictly (RFC 1833 sec. 2.2.2).
Sourcepub async fn indirect(
&mut self,
program: u32,
version: u32,
proc: u32,
args: &[u8],
) -> Result<RpcbRmtCallRes, RpcError>
pub async fn indirect( &mut self, program: u32, version: u32, proc: u32, args: &[u8], ) -> Result<RpcbRmtCallRes, RpcError>
RPCBPROC_INDIRECT (proc 10, version 4): indirect RPC call with error reporting (RFC 1833 sec. 2.2.2).
Sourcepub async fn getaddrlist(
&mut self,
program: u32,
version: u32,
netid: &str,
) -> Result<Vec<RpcbAddrEntry>, RpcError>
pub async fn getaddrlist( &mut self, program: u32, version: u32, netid: &str, ) -> Result<Vec<RpcbAddrEntry>, RpcError>
RPCBPROC_GETADDRLIST (proc 11, version 4): list all addresses for a service across transports (RFC 1833 sec. 2.2.2).
Sourcepub async fn getstat(&mut self) -> Result<RpcbStatByvers, RpcError>
pub async fn getstat(&mut self) -> Result<RpcbStatByvers, RpcError>
RPCBPROC_GETSTAT (proc 12, version 4): returns operational statistics per rpcbind version.