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.Secret.Structs.Value
Description
A value containing a secret
A Value
contains a password or other secret value.
Use [methodvalue
.get] to get the actual secret data, such as a password.
The secret data is not necessarily null-terminated, unless the content type
is "text/plain".
Each Value
has a content type. For passwords, this is text/plain
.
Use [methodvalue
.get_content_type] to look at the content type.
Value
is reference counted and immutable. The secret data is only
freed when all references have been released via [methodvalue
.unref].
Synopsis
- newtype Value = Value (ManagedPtr Value)
- type family ResolveValueMethod (t :: Symbol) o where ...
- data ValueGetMethodInfo
- valueGet :: (HasCallStack, MonadIO m) => Value -> m ByteString
- data ValueGetContentTypeMethodInfo
- valueGetContentType :: (HasCallStack, MonadIO m) => Value -> m Text
- data ValueGetTextMethodInfo
- valueGetText :: (HasCallStack, MonadIO m) => Value -> m (Maybe Text)
- valueNew :: (HasCallStack, MonadIO m) => Text -> Int64 -> Text -> m Value
- valueNewFull :: (HasCallStack, MonadIO m) => Text -> Int64 -> Text -> DestroyNotify -> m Value
- data ValueRefMethodInfo
- valueRef :: (HasCallStack, MonadIO m) => Value -> m Value
- data ValueUnrefMethodInfo
- valueUnref :: (HasCallStack, MonadIO m) => Value -> m ()
- data ValueUnrefToPasswordMethodInfo
- valueUnrefToPassword :: (HasCallStack, MonadIO m) => Value -> CSize -> m (Text, CSize)
Exported types
Memory-managed wrapper type.
Constructors
Value (ManagedPtr Value) |
Instances
Methods
Click to display all available methods, including inherited ones
type family ResolveValueMethod (t :: Symbol) o where ... Source #
Equations
ResolveValueMethod "get" o = ValueGetMethodInfo | |
ResolveValueMethod "ref" o = ValueRefMethodInfo | |
ResolveValueMethod "unref" o = ValueUnrefMethodInfo | |
ResolveValueMethod "unrefToPassword" o = ValueUnrefToPasswordMethodInfo | |
ResolveValueMethod "getContentType" o = ValueGetContentTypeMethodInfo | |
ResolveValueMethod "getText" o = ValueGetTextMethodInfo | |
ResolveValueMethod l o = MethodResolutionFailed l o :: Type |
get
data ValueGetMethodInfo Source #
Instances
(signature ~ m ByteString, MonadIO m) => OverloadedMethod ValueGetMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueGetMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m ByteString | Returns: the secret data |
Get the secret data in the Value
.
The value is not necessarily null-terminated unless it was created with
[ctorvalue
.new] or a null-terminated string was passed to
[ctorvalue
.new_full].
getContentType
data ValueGetContentTypeMethodInfo Source #
Instances
(signature ~ m Text, MonadIO m) => OverloadedMethod ValueGetContentTypeMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueGetContentTypeMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m Text | Returns: the content type |
Get the content type of the secret value, such as
text/plain
.
getText
data ValueGetTextMethodInfo Source #
Instances
(signature ~ m (Maybe Text), MonadIO m) => OverloadedMethod ValueGetTextMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueGetTextMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m (Maybe Text) | Returns: the content type |
Get the secret data in the Value
if it contains a textual
value.
The content type must be text/plain
.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int64 |
|
-> Text |
|
-> m Value | Returns: the new |
Create a Value
for the secret data passed in.
The secret data is copied into non-pageable 'secure' memory.
If the length is less than zero, then secret
is assumed to be
null-terminated.
newFull
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int64 |
|
-> Text |
|
-> DestroyNotify |
|
-> m Value | Returns: the new |
Create a Value
for the secret data passed in.
The secret data is not copied, and will later be freed with the destroy
function.
If the length is less than zero, then secret
is assumed to be
null-terminated.
ref
data ValueRefMethodInfo Source #
Instances
(signature ~ m Value, MonadIO m) => OverloadedMethod ValueRefMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueRefMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m Value | Returns: the value |
Add another reference to the Value
.
For each reference [methodvalue
.unref] should be called to unreference the
value.
unref
data ValueUnrefMethodInfo Source #
Instances
(signature ~ m (), MonadIO m) => OverloadedMethod ValueUnrefMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueUnrefMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m () |
Unreference a Value
.
When the last reference is gone, then the value will be freed.
unrefToPassword
data ValueUnrefToPasswordMethodInfo Source #
Instances
(signature ~ (CSize -> m (Text, CSize)), MonadIO m) => OverloadedMethod ValueUnrefToPasswordMethodInfo Value signature Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethod :: Value -> signature | |
OverloadedMethodInfo ValueUnrefToPasswordMethodInfo Value Source # | |
Defined in GI.Secret.Structs.Value Methods overloadedMethodInfo :: Maybe ResolvedSymbolInfo |