[][src]Struct qt_core::q_io_device::OpenModeFlag

#[repr(transparent)]
pub struct OpenModeFlag(_);

This enum is used with open() to describe the mode in which a device is opened. It is also returned by openMode().

C++ enum: QIODevice::OpenModeFlag.

C++ documentation:

This enum is used with open() to describe the mode in which a device is opened. It is also returned by openMode().

Certain flags, such as Unbuffered and Truncate, are meaningless when used with some subclasses. Some of these restrictions are implied by the type of device that is represented by a subclass. In other cases, the restriction may be due to the implementation, or may be imposed by the underlying platform; for example, QTcpSocket does not support Unbuffered mode, and limitations in the native API prevent QFile from supporting Unbuffered on Windows.

The OpenMode type is a typedef for QFlags<OpenModeFlag>. It stores an OR combination of OpenModeFlag values.

Methods

impl OpenModeFlag[src]

pub fn to_int(&self) -> c_int[src]

impl OpenModeFlag[src]

pub const NotOpen: OpenModeFlag[src]

The device is not open. (C++ enum variant: NotOpen = 0)

pub const ReadOnly: OpenModeFlag[src]

The device is open for reading. (C++ enum variant: ReadOnly = 1)

pub const WriteOnly: OpenModeFlag[src]

The device is open for writing. Note that this mode implies Truncate. (C++ enum variant: WriteOnly = 2)

pub const ReadWrite: OpenModeFlag[src]

The device is open for reading and writing. (C++ enum variant: ReadWrite = 3)

pub const Append: OpenModeFlag[src]

The device is opened in append mode so that all data is written to the end of the file. (C++ enum variant: Append = 4)

pub const Truncate: OpenModeFlag[src]

If possible, the device is truncated before it is opened. All earlier contents of the device are lost. (C++ enum variant: Truncate = 8)

pub const Text: OpenModeFlag[src]

When reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32. (C++ enum variant: Text = 16)

pub const Unbuffered: OpenModeFlag[src]

Any buffer in the device is bypassed. (C++ enum variant: Unbuffered = 32)

pub const NewOnly: OpenModeFlag[src]

Fail if the file to be opened already exists. Create and open the file only if it does not exist. There is a guarantee from the operating system that you are the only one creating and opening the file. Note that this mode implies WriteOnly, and combining it with ReadWrite is allowed. This flag currently only affects QFile. Other classes might use this flag in the future, but until then using this flag with any classes other than QFile may result in undefined behavior. (C++ enum variant: NewOnly = 64)

pub const ExistingOnly: OpenModeFlag[src]

Fail if the file to be opened does not exist. This flag must be specified alongside ReadOnly, WriteOnly, or ReadWrite. Note that using this flag with ReadOnly alone is redundant, as ReadOnly already fails when the file does not exist. This flag currently only affects QFile. Other classes might use this flag in the future, but until then using this flag with any classes other than QFile may result in undefined behavior. (C++ enum variant: ExistingOnly = 128)

Trait Implementations

impl From<i32> for OpenModeFlag[src]

impl From<OpenModeFlag> for c_int[src]

impl From<OpenModeFlag> for QFlags<OpenModeFlag>[src]

impl Clone for OpenModeFlag[src]

impl Copy for OpenModeFlag[src]

impl Eq for OpenModeFlag[src]

impl PartialEq<OpenModeFlag> for OpenModeFlag[src]

impl Debug for OpenModeFlag[src]

impl<T: Into<QFlags<OpenModeFlag>>> BitOr<T> for OpenModeFlag[src]

type Output = QFlags<OpenModeFlag>

The resulting type after applying the | operator.

impl StructuralPartialEq for OpenModeFlag[src]

impl StructuralEq for OpenModeFlag[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]