Trait gio::prelude::DataInputStreamExt [−][src]
pub trait DataInputStreamExt: 'static {}Show methods
fn byte_order(&self) -> DataStreamByteOrder; fn newline_type(&self) -> DataStreamNewlineType; fn read_byte<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u8, Error>; fn read_int16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i16, Error>; fn read_int32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i32, Error>; fn read_int64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i64, Error>; fn read_uint16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u16, Error>; fn read_uint32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u32, Error>; fn read_uint64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u64, Error>; fn set_byte_order(&self, order: DataStreamByteOrder); fn set_newline_type(&self, type_: DataStreamNewlineType); fn connect_byte_order_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId; fn connect_newline_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
Expand description
Required methods
fn byte_order(&self) -> DataStreamByteOrder
fn byte_order(&self) -> DataStreamByteOrder
fn newline_type(&self) -> DataStreamNewlineType
fn newline_type(&self) -> DataStreamNewlineType
Reads an unsigned 8-bit/1-byte value from self
.
cancellable
optional Cancellable
object, None
to ignore.
Returns
an unsigned 8-bit/1-byte value read from the self
or 0
if an error occurred.
fn read_int16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i16, Error>
fn read_int16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i16, Error>
Reads a 16-bit/2-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
and set_byte_order()
.
cancellable
optional Cancellable
object, None
to ignore.
Returns
a signed 16-bit/2-byte value read from self
or 0
if
an error occurred.
fn read_int32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i32, Error>
fn read_int32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i32, Error>
Reads a signed 32-bit/4-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
and set_byte_order()
.
If cancellable
is not None
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnum::Cancelled
will be returned.
cancellable
optional Cancellable
object, None
to ignore.
Returns
a signed 32-bit/4-byte value read from the self
or 0
if
an error occurred.
fn read_int64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i64, Error>
fn read_int64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<i64, Error>
Reads a 64-bit/8-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
and set_byte_order()
.
If cancellable
is not None
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnum::Cancelled
will be returned.
cancellable
optional Cancellable
object, None
to ignore.
Returns
a signed 64-bit/8-byte value read from self
or 0
if
an error occurred.
fn read_uint16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u16, Error>
fn read_uint16<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u16, Error>
Reads an unsigned 16-bit/2-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
and set_byte_order()
.
cancellable
optional Cancellable
object, None
to ignore.
Returns
an unsigned 16-bit/2-byte value read from the self
or 0
if
an error occurred.
fn read_uint32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u32, Error>
fn read_uint32<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u32, Error>
Reads an unsigned 32-bit/4-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
and set_byte_order()
.
If cancellable
is not None
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnum::Cancelled
will be returned.
cancellable
optional Cancellable
object, None
to ignore.
Returns
an unsigned 32-bit/4-byte value read from the self
or 0
if
an error occurred.
fn read_uint64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u64, Error>
fn read_uint64<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<u64, Error>
Reads an unsigned 64-bit/8-byte value from self
.
In order to get the correct byte order for this read operation,
see byte_order()
.
If cancellable
is not None
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnum::Cancelled
will be returned.
cancellable
optional Cancellable
object, None
to ignore.
Returns
an unsigned 64-bit/8-byte read from self
or 0
if
an error occurred.
fn set_byte_order(&self, order: DataStreamByteOrder)
fn set_byte_order(&self, order: DataStreamByteOrder)
This function sets the byte order for the given self
. All subsequent
reads from the self
will be read in the given order
.
order
a DataStreamByteOrder
to set.
fn set_newline_type(&self, type_: DataStreamNewlineType)
fn set_newline_type(&self, type_: DataStreamNewlineType)
Sets the newline type for the self
.
Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read chunk ends in “CR” we must read an additional byte to know if this is “CR” or “CR LF”, and this might block if there is no more data available.
type_
the type of new line return as DataStreamNewlineType
.
fn connect_byte_order_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_newline_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId