Struct argdata::fd::EncodedFd [−][src]
pub struct EncodedFd<T> { /* fields omitted */ }
A file descriptor in some argdata.
Methods
impl<T: ConvertFd> EncodedFd<T>
[src]
impl<T: ConvertFd> EncodedFd<T>
pub fn new(raw: u32, convert_fd: T) -> EncodedFd<T>
[src]
pub fn new(raw: u32, convert_fd: T) -> EncodedFd<T>
Create an EncodedFd that will convert raw
to an Fd
using convert_fd
.
pub fn raw_encoded_number(&self) -> u32
[src]
pub fn raw_encoded_number(&self) -> u32
The 32-bit file descriptor number exactly as encoded in the raw argdata.
pub fn to_fd(&self) -> Result<Fd, u32>
[src]
pub fn to_fd(&self) -> Result<Fd, u32>
Converts this to a valid file descriptor, if possible.
On failure, the raw encoded number is returned as an error.
Trait Implementations
impl<T: Clone> Clone for EncodedFd<T>
[src]
impl<T: Clone> Clone for EncodedFd<T>
fn clone(&self) -> EncodedFd<T>
[src]
fn clone(&self) -> EncodedFd<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for EncodedFd<T>
[src]
impl<T: Copy> Copy for EncodedFd<T>
impl<'d, T: ConvertFd> Argdata<'d> for EncodedFd<T>
[src]
impl<'d, T: ConvertFd> Argdata<'d> for EncodedFd<T>
fn read<'a>(&'a self) -> Result<Value<'a, 'd>, ReadError> where
'd: 'a,
[src]
fn read<'a>(&'a self) -> Result<Value<'a, 'd>, ReadError> where
'd: 'a,
Read the value.
fn serialized_length(&self) -> usize
[src]
fn serialized_length(&self) -> usize
The number of bytes that self.serialize()
will write.
fn serialize(
&self,
writer: &mut Write,
fd_map: Option<&mut FdMapping>
) -> Result<()>
[src]
fn serialize(
&self,
writer: &mut Write,
fd_map: Option<&mut FdMapping>
) -> Result<()>
Serialize the argdata to the given writer. Read more
fn get_type(&self) -> Result<Type, ReadError>
[src]
fn get_type(&self) -> Result<Type, ReadError>
Read the type of the value.
fn read_null(&self) -> Result<(), NotRead>
[src]
fn read_null(&self) -> Result<(), NotRead>
Check if the value is null.
fn read_binary(&self) -> Result<&'d [u8], NotRead>
[src]
fn read_binary(&self) -> Result<&'d [u8], NotRead>
Check if the value is a binary blob, and read it if it is.
fn read_bool(&self) -> Result<bool, NotRead>
[src]
fn read_bool(&self) -> Result<bool, NotRead>
Check if the value is a boolean, and read it if it is.
fn read_encoded_fd<'a>(&'a self) -> Result<EncodedFd<&'a ConvertFd>, NotRead> where
'd: 'a,
[src]
fn read_encoded_fd<'a>(&'a self) -> Result<EncodedFd<&'a ConvertFd>, NotRead> where
'd: 'a,
Check if the value is a file descriptor, and return it if it is. Read more
fn read_float(&self) -> Result<f64, NotRead>
[src]
fn read_float(&self) -> Result<f64, NotRead>
Check if the value is a float, and read it if it is.
fn read_int_value(&self) -> Result<IntValue<'d>, NotRead>
[src]
fn read_int_value(&self) -> Result<IntValue<'d>, NotRead>
Check if the value is an integer, and read it if it is. Read more
fn read_map<'a>(&'a self) -> Result<&'a Map<'d>, NotRead> where
'd: 'a,
[src]
fn read_map<'a>(&'a self) -> Result<&'a Map<'d>, NotRead> where
'd: 'a,
Check if the value is a map, and get access to it if it is.
fn read_seq<'a>(&'a self) -> Result<&'a Seq<'d>, NotRead> where
'd: 'a,
[src]
fn read_seq<'a>(&'a self) -> Result<&'a Seq<'d>, NotRead> where
'd: 'a,
Check if the value is a seq, and get access to it if it is.
fn read_str_value(&self) -> Result<StrValue<'d>, NotRead>
[src]
fn read_str_value(&self) -> Result<StrValue<'d>, NotRead>
Check if the value is a string, and read it if it is. Read more
fn read_timestamp(&self) -> Result<Timespec, NotRead>
[src]
fn read_timestamp(&self) -> Result<Timespec, NotRead>
Check if the value is a timestamp, and read it if it is.