Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gio.Objects.UnixInputStream
Description
GUnixInputStream
implements InputStream
for reading from a UNIX
file descriptor, including asynchronous operations. (If the file
descriptor refers to a socket or pipe, this will use poll()
to do
asynchronous I/O. If it refers to a regular file, it will fall back
to doing asynchronous I/O in another thread.)
Note that <gio/gunixinputstream.h>
belongs to the UNIX-specific GIO
interfaces, thus you have to use the gio-unix-2.0.pc
pkg-config
file or the GioUnix-2.0
GIR namespace when using it.
Synopsis
- newtype UnixInputStream = UnixInputStream (ManagedPtr UnixInputStream)
- class (GObject o, IsDescendantOf UnixInputStream o) => IsUnixInputStream o
- toUnixInputStream :: (MonadIO m, IsUnixInputStream o) => o -> m UnixInputStream
- type family ResolveUnixInputStreamMethod (t :: Symbol) o where ...
- data UnixInputStreamGetCloseFdMethodInfo
- unixInputStreamGetCloseFd :: (HasCallStack, MonadIO m, IsUnixInputStream a) => a -> m Bool
- data UnixInputStreamGetFdMethodInfo
- unixInputStreamGetFd :: (HasCallStack, MonadIO m, IsUnixInputStream a) => a -> m Int32
- unixInputStreamNew :: (HasCallStack, MonadIO m) => Int32 -> Bool -> m UnixInputStream
- data UnixInputStreamSetCloseFdMethodInfo
- unixInputStreamSetCloseFd :: (HasCallStack, MonadIO m, IsUnixInputStream a) => a -> Bool -> m ()
- data UnixInputStreamCloseFdPropertyInfo
- constructUnixInputStreamCloseFd :: (IsUnixInputStream o, MonadIO m) => Bool -> m (GValueConstruct o)
- getUnixInputStreamCloseFd :: (MonadIO m, IsUnixInputStream o) => o -> m Bool
- setUnixInputStreamCloseFd :: (MonadIO m, IsUnixInputStream o) => o -> Bool -> m ()
- unixInputStreamCloseFd :: AttrLabelProxy "closeFd"
- data UnixInputStreamFdPropertyInfo
- constructUnixInputStreamFd :: (IsUnixInputStream o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getUnixInputStreamFd :: (MonadIO m, IsUnixInputStream o) => o -> m Int32
- unixInputStreamFd :: AttrLabelProxy "fd"
Exported types
newtype UnixInputStream Source #
Memory-managed wrapper type.
Constructors
UnixInputStream (ManagedPtr UnixInputStream) |
Instances
class (GObject o, IsDescendantOf UnixInputStream o) => IsUnixInputStream o Source #
Type class for types which can be safely cast to UnixInputStream
, for instance with toUnixInputStream
.
Instances
(GObject o, IsDescendantOf UnixInputStream o) => IsUnixInputStream o Source # | |
Defined in GI.Gio.Objects.UnixInputStream |
toUnixInputStream :: (MonadIO m, IsUnixInputStream o) => o -> m UnixInputStream Source #
Cast to UnixInputStream
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, canPoll, clearPending, close, closeAsync, closeFinish, createSource, forceFloating, freezeNotify, getv, hasPending, isClosed, isFloating, isReadable, notify, notifyByPspec, read, readAll, readAllAsync, readAllFinish, readAsync, readBytes, readBytesAsync, readBytesFinish, readFinish, readNonblocking, ref, refSink, runDispose, skip, skipAsync, skipFinish, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCloseFd, getData, getFd, getProperty, getQdata.
Setters
type family ResolveUnixInputStreamMethod (t :: Symbol) o where ... Source #
Equations
getCloseFd
data UnixInputStreamGetCloseFdMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsUnixInputStream a) => OverloadedMethod UnixInputStreamGetCloseFdMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo UnixInputStreamGetCloseFdMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods |
unixInputStreamGetCloseFd Source #
Arguments
:: (HasCallStack, MonadIO m, IsUnixInputStream a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the file descriptor of stream
will be
closed when the stream is closed.
Since: 2.20
getFd
data UnixInputStreamGetFdMethodInfo Source #
Instances
(signature ~ m Int32, MonadIO m, IsUnixInputStream a) => OverloadedMethod UnixInputStreamGetFdMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo UnixInputStreamGetFdMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods |
Arguments
:: (HasCallStack, MonadIO m, IsUnixInputStream a) | |
=> a |
|
-> m Int32 | Returns: The file descriptor of |
Return the UNIX file descriptor that the stream reads from.
Since: 2.20
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Bool |
|
-> m UnixInputStream | Returns: a new |
Creates a new UnixInputStream
for the given fd
.
If closeFd
is True
, the file descriptor will be closed
when the stream is closed.
setCloseFd
data UnixInputStreamSetCloseFdMethodInfo Source #
Instances
(signature ~ (Bool -> m ()), MonadIO m, IsUnixInputStream a) => OverloadedMethod UnixInputStreamSetCloseFdMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo UnixInputStreamSetCloseFdMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.UnixInputStream Methods |
unixInputStreamSetCloseFd Source #
Arguments
:: (HasCallStack, MonadIO m, IsUnixInputStream a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the file descriptor of stream
shall be closed
when the stream is closed.
Since: 2.20
Properties
closeFd
Whether to close the file descriptor when the stream is closed.
Since: 2.20
data UnixInputStreamCloseFdPropertyInfo Source #
Instances
constructUnixInputStreamCloseFd :: (IsUnixInputStream o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “close-fd
” property. This is rarely needed directly, but it is used by new
.
getUnixInputStreamCloseFd :: (MonadIO m, IsUnixInputStream o) => o -> m Bool Source #
Get the value of the “close-fd
” property.
When overloading is enabled, this is equivalent to
get
unixInputStream #closeFd
setUnixInputStreamCloseFd :: (MonadIO m, IsUnixInputStream o) => o -> Bool -> m () Source #
Set the value of the “close-fd
” property.
When overloading is enabled, this is equivalent to
set
unixInputStream [ #closeFd:=
value ]
unixInputStreamCloseFd :: AttrLabelProxy "closeFd" Source #
fd
The file descriptor that the stream reads from.
Since: 2.20
data UnixInputStreamFdPropertyInfo Source #
Instances
AttrInfo UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream Associated Types
Methods attrGet :: AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo o => o -> IO (AttrGetType UnixInputStreamFdPropertyInfo) # attrSet :: (AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo o, AttrSetTypeConstraint UnixInputStreamFdPropertyInfo b) => o -> b -> IO () # attrClear :: AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo o => o -> IO () # attrConstruct :: (AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo o, AttrSetTypeConstraint UnixInputStreamFdPropertyInfo b) => b -> IO (GValueConstruct o) # attrTransfer :: (AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo o, AttrTransferTypeConstraint UnixInputStreamFdPropertyInfo b) => Proxy o -> b -> IO (AttrTransferType UnixInputStreamFdPropertyInfo) # | |||||||||||||||||||||||||||||||||
type AttrAllowedOps UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrBaseTypeConstraint UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
type AttrGetType UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrLabel UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrOrigin UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrSetTypeConstraint UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrTransferType UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.Gio.Objects.UnixInputStream | |||||||||||||||||||||||||||||||||
type AttrTransferTypeConstraint UnixInputStreamFdPropertyInfo Source # | |||||||||||||||||||||||||||||||||
constructUnixInputStreamFd :: (IsUnixInputStream o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “fd
” property. This is rarely needed directly, but it is used by new
.
getUnixInputStreamFd :: (MonadIO m, IsUnixInputStream o) => o -> m Int32 Source #
Get the value of the “fd
” property.
When overloading is enabled, this is equivalent to
get
unixInputStream #fd
unixInputStreamFd :: AttrLabelProxy "fd" Source #