Structureswift-nio 2.72.0NIOCore
Mode
Mode
represents file access modes.
struct Mode
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (10) members.
Types
struct Flags
Flags
allows to specify additional flags toMode
, such as permission for file creation.
Type members
init(descriptor: CInt
) Create a
NIOFileHandle
taking ownership ofdescriptor
. You must callNIOFileHandle.close
orNIOFileHandle.takeDescriptorOwnership
before this object can be safely released.init(path: String
) throws Open a new
NIOFileHandle
. This operation is blocking.init(path: String, mode: Mode, flags: Flags
) throws Open a new
NIOFileHandle
. This operation is blocking.
Instance members
var description: String
var isOpen: Bool
func close(
) throws func duplicate(
) throws -> NIOFileHandle Duplicates this
NIOFileHandle
. This means that a newNIOFileHandle
object with a new underlying file descriptor is returned. The caller takes ownership of the returnedNIOFileHandle
and is responsible for closing it.func takeDescriptorOwnership(
) throws -> CInt Take the ownership of the underlying file descriptor. This is similar to
close()
but the underlying file descriptor remains open. The caller is responsible for closing the file descriptor by some other means.func withUnsafeFileDescriptor<T>((CInt) throws -> T
) throws -> T
Citizens in NIOCore
Conformances
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol OptionSet
A type that presents a mathematical set interface to a bit set.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
protocol SetAlgebra<Element>
A type that provides mathematical set operations.
Type members
init(rawValue: UInt8
) static let read: NIOFileHandle.Mode
Opens file for reading
static let write: NIOFileHandle.Mode
Opens file for writing
Instance members
Type features
init(
) Creates an empty option set.
init<S>(S
) Creates a new set from a finite sequence of items.
init(arrayLiteral: Self.Element...
) Creates a set containing the elements of the given array literal.
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.
Instance features
var isEmpty: Bool
A Boolean value that indicates whether the set has no elements.
func contains(Self
) -> Bool Returns a Boolean value that indicates whether a given element is a member of the option set.
func formIntersection(Self
) Removes all elements of this option set that are not also present in the given set.
func formSymmetricDifference(Self
) Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
func formUnion(Self
) Inserts the elements of another set into this option set.
func insert(Self.Element
) -> (inserted: Bool, memberAfterInsert: Self.Element) Adds the given element to the option set if it is not already a member.
func intersection(Self
) -> Self Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with: Self
) -> Bool Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a superset of the given set.
func remove(Self.Element
) -> Self.Element? Removes the given element and all elements subsumed by it.
func subtract(Self
) Removes the elements of the given set from this set.
func subtracting(Self
) -> Self Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(Self
) -> Self Returns a new option set with the elements contained in this set or in the given set, but not in both.
func union(Self
) -> Self Returns a new option set of the elements contained in this set, in the given set, or in both.
func update(with: Self.Element
) -> Self.Element? Inserts the given element into the set.