gi-gio-2.0.27: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.InetAddressMask

Contents

- Exported types
- Methods
  - Overloaded methods
  - equal
  - getAddress
  - getFamily
  - getLength
  - matches
  - new
  - newFromString
  - toString
- Properties
  - address
  - family
  - length

Description

`InetAddressMask` represents a range of IPv4 or IPv6 addresses described by a base address and a length indicating how many bits of the base address are relevant for matching purposes. These are often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".

Since: 2.32

Synopsis

- newtype InetAddressMask = InetAddressMask (ManagedPtr InetAddressMask)
- class (GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o
- toInetAddressMask :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddressMask
- inetAddressMaskEqual :: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) => a -> b -> m Bool
- inetAddressMaskGetAddress :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m InetAddress
- inetAddressMaskGetFamily :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m SocketFamily
- inetAddressMaskGetLength :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m Word32
- inetAddressMaskMatches :: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) => a -> b -> m Bool
- inetAddressMaskNew :: (HasCallStack, MonadIO m, IsInetAddress a) => a -> Word32 -> m InetAddressMask
- inetAddressMaskNewFromString :: (HasCallStack, MonadIO m) => Text -> m InetAddressMask
- inetAddressMaskToString :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m Text
- clearInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m ()
- constructInetAddressMaskAddress :: (IsInetAddressMask o, MonadIO m, IsInetAddress a) => a -> m (GValueConstruct o)
- getInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddress
- setInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o, IsInetAddress a) => o -> a -> m ()
- getInetAddressMaskFamily :: (MonadIO m, IsInetAddressMask o) => o -> m SocketFamily
- constructInetAddressMaskLength :: (IsInetAddressMask o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> m Word32
- setInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> Word32 -> m ()

# Exported types

newtype InetAddressMask Source #

Memory-managed wrapper type.

Constructors

InetAddressMask (ManagedPtr InetAddressMask) |

#### Instances

Instances details

Eq InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask Methods (==) :: InetAddressMask -> InetAddressMask -> Bool # (/=) :: InetAddressMask -> InetAddressMask -> Bool #
GObject InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask
TypedObject InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask Methods glibType :: IO GType Source #
ManagedPtrNewtype InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask Methods toManagedPtr :: InetAddressMask -> ManagedPtr InetAddressMask Source #
IsGValue InetAddressMask Source # | Convert `InetAddressMask` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.InetAddressMask Methods toGValue :: InetAddressMask -> IO GValue Source # fromGValue :: GValue -> IO InetAddressMask Source #
HasParentTypes InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask
type ParentTypes InetAddressMask Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask type ParentTypes InetAddressMask = '[Object, Initable]

class (GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o Source #

Type class for types which can be safely cast to `InetAddressMask`, for instance with `toInetAddressMask`.

#### Instances

Instances details

(GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o Source # |
Instance details Defined in GI.Gio.Objects.InetAddressMask

toInetAddressMask :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddressMask Source #

Cast to `InetAddressMask`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

## Overloaded methods

## equal

inetAddressMaskEqual Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) |
=> a | `mask`: a `InetAddressMask`
-> b | `mask2`: another `InetAddressMask`
-> m Bool | Returns: whether `mask` and `mask2` are the same mask

Tests if `mask` and `mask2` are the same mask.

Since: 2.32

## getAddress

inetAddressMaskGetAddress Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) |
=> a | `mask`: a `InetAddressMask`
-> m InetAddress | Returns: `mask`'s base address

Gets `mask`'s base address

Since: 2.32

## getFamily

inetAddressMaskGetFamily Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) |
=> a | `mask`: a `InetAddressMask`
-> m SocketFamily | Returns: the `SocketFamily` of `mask`'s address

Gets the `SocketFamily` of `mask`'s address

Since: 2.32

## getLength

inetAddressMaskGetLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) |
=> a | `mask`: a `InetAddressMask`
-> m Word32 | Returns: `mask`'s length

Gets `mask`'s length

Since: 2.32

## matches

inetAddressMaskMatches Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) |
=> a | `mask`: a `InetAddressMask`
-> b | `address`: a `InetAddress`
-> m Bool | Returns: whether `address` falls within the range described by `mask`.

Tests if `address` falls within the range described by `mask`.

Since: 2.32

## new

inetAddressMaskNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddress a) |
=> a | `addr`: a `InetAddress`
-> Word32 | `length`: number of bits of `addr` to use
-> m InetAddressMask | Returns: a new `InetAddressMask`, or `Nothing` on error (Can throw `GError`)

Creates a new `InetAddressMask` representing all addresses whose first `length` bits match `addr`.

Since: 2.32

## newFromString

inetAddressMaskNewFromString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `maskString`: an IP address or address/length string
-> m InetAddressMask | Returns: a new `InetAddressMask` corresponding to `string`, or `Nothing` on error. (Can throw `GError`)

Parses `maskString` as an IP address and (optional) length, and creates a new `InetAddressMask`. The length, if present, is delimited by a "/". If it is not present, then the length is assumed to be the full length of the address.

Since: 2.32

## toString

inetAddressMaskToString Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) |
=> a | `mask`: a `InetAddressMask`
-> m Text | Returns: a string corresponding to `mask`.

Converts `mask` back to its corresponding string form.

Since: 2.32

# Properties

## address

No description available in the introspection data.

clearInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m () Source #

Set the value of the “`address`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #address

constructInetAddressMaskAddress :: (IsInetAddressMask o, MonadIO m, IsInetAddress a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`address`” property. This is rarely needed directly, but it is used by `new`.

getInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddress Source #

Get the value of the “`address`” property. When overloading is enabled, this is equivalent to

    get inetAddressMask #address

setInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o, IsInetAddress a) => o -> a -> m () Source #

Set the value of the “`address`” property. When overloading is enabled, this is equivalent to

    set inetAddressMask [ #address := value ]

## family

No description available in the introspection data.

getInetAddressMaskFamily :: (MonadIO m, IsInetAddressMask o) => o -> m SocketFamily Source #

Get the value of the “`family`” property. When overloading is enabled, this is equivalent to

    get inetAddressMask #family

## length

No description available in the introspection data.

constructInetAddressMaskLength :: (IsInetAddressMask o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`length`” property. This is rarely needed directly, but it is used by `new`.

getInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> m Word32 Source #

Get the value of the “`length`” property. When overloading is enabled, this is equivalent to

    get inetAddressMask #length

setInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> Word32 -> m () Source #

Set the value of the “`length`” property. When overloading is enabled, this is equivalent to

    set inetAddressMask [ #length := value ]