Lines Matching refs:path
38 use std::path::Path;
796 // A trailing NUL is not considered part of the path, and it does
813 /// Create a new sockaddr_un representing a filesystem path.
814 pub fn new<P: ?Sized + NixPath>(path: &P) -> Result<UnixAddr> {
815 path.with_nix_path(|cstr| unsafe {
856 /// thus the input `path` is expected to be the bare name, not NUL-prefixed.
861 pub fn new_abstract(path: &[u8]) -> Result<UnixAddr> {
868 if path.len() >= ret.sun_path.len() {
872 (path.len() + 1 + offset_of!(libc::sockaddr_un, sun_path))
879 path.as_ptr(),
881 path.len(),
912 /// fs path, not necessarily nul-terminated.
937 /// If this address represents a filesystem path, return that path.
938 pub fn path(&self) -> Option<&Path> {
940 UnixAddrKind::Pathname(path) => Some(path),
948 /// leading NUL byte. `None` is returned for unnamed or path-backed sockets.
1075 UnixAddrKind::Pathname(path) => path.display().fmt(f),
2036 pub fn new_unix<P: ?Sized + NixPath>(path: &P) -> Result<SockAddr> {
2037 Ok(SockAddr::Unix(UnixAddr::new(path)?))