Protocols
The following protocols are available globally.
-
A class-bound protocol which implements a strategy for dereferencing aliases (or dealiasing) values during YAML document decoding. YAML documents which do not contain anchors will not benefit from the use of an AliasDereferencingStrategy in any way. The main use-case for dereferencing aliases in a YML document is when decoding into class types. If the yaml document is large and contains many references (perhaps it is a representation of a dense graph) then, decoding into structs will require the of large amounts of system memory to represent highly redundant (duplicated) data structures. However, if the same document is decoded into class types and the decoding uses an
See moreAliasDereferencingStrategy
such asBasicAliasDereferencingStrategy
then the emitted value will have its class references coalesced. No duplicate objects will be initialized (unless identical objects have multiple distinct anchors in the YAML document). In some scenarios this may significantly reduce the memory footprint of the decoded type.Declaration
Swift
public protocol AliasDereferencingStrategy : AnyObject
-
Types conforming to this protocol can be extracted
See moreNode.Scalar
s.Declaration
Swift
public protocol ScalarConstructible
-
Confirming types are convertible to base 60 numeric values.
See moreDeclaration
Swift
public protocol SexagesimalConvertible : ExpressibleByIntegerLiteral
-
A class-bound protocol which implements a strategy for detecting aliasable values in a YAML document. Implementations should return RedundancyAliasingOutcome.anchor(…) for the first occurrence of a value. Subsequent occurrences of the same value (where same-ness is defined by the implementation) should return RedundancyAliasingOutcome.alias(…) where the contained Anchor has the same value as the previously returned RedundancyAliasingOutcome.anchor(…). Its the identity of the Anchor values returned that ultimately informs the YAML encoder when to use aliases. N,B. It is essential that implementations release all references to Anchors which are created by this type when releaseAnchorReferences() is called by the Encoder. After this call the implementation will no longer be referenced by the Encoder and will itself be released.
See moreDeclaration
Swift
public protocol RedundancyAliasingStrategy : AnyObject
-
Declaration
Swift
public protocol NodeRepresentable
-
Type is representable as
See moreNode.scalar
.Declaration
Swift
public protocol ScalarRepresentable : NodeRepresentable
-
Types conforming to this protocol can be encoded by
See moreYamlEncoder
.Declaration
Swift
public protocol YAMLEncodable : Encodable
-
Types that conform to YamlAnchorProviding and Encodable can optionally dictate the name of a yaml anchor when they are encoded with YAMLEncoder
See moreDeclaration
Swift
public protocol YamlAnchorProviding
-
YamlAnchorCoding refines YamlAnchorProviding. Types that conform to YamlAnchorCoding and Decodable can decode yaml anchors from source documents into
See moreAnchor
values for reference or modification in memory.Declaration
Swift
public protocol YamlAnchorCoding : YamlAnchorProviding
-
Types that conform to YamlTagProviding and Encodable can optionally dictate the name of a yaml tag when they are encoded with YAMLEncoder
See moreDeclaration
Swift
public protocol YamlTagProviding
-
YamlTagCoding refines YamlTagProviding. Types that conform to YamlTagCoding and Decodable can decode yaml tags from source documents into
See moreTag
values for reference or modification in memory.Declaration
Swift
public protocol YamlTagCoding : YamlTagProviding