String (ext)
You’re viewing third-party extensions to String
, a struct from the Swift standard library.
You can also read the documentation forString
itself.
extension String
You’re viewing third-party extensions to String
, a struct from the Swift standard library.
You can also read the documentation forString
itself.
extension String
@frozen struct String
A Unicode string value that is a collection of characters.
import BSONDecoding
Implements the BSON decoding system.
protocol BSONDecodable
A type that can be decoded from a BSON variant value backed by some type of storage not particular to the decoded type.
protocol BSONStringDecodable : BSONDecodable
A type that can be decoded from a BSON UTF-8 string. Javascript sources count as UTF-8 strings, from the perspective of this protocol. This protocol exists to allow types that also conform to LosslessStringConvertible
to opt-in to automatic BSONDecodable
conformance as well.
init(bson: BSON.UTF8View<ArraySlice<UInt8>>)
Copies and validates the backing storage of the given UTF-8 string to a native Swift string, repairing invalid code units if needed.
init(bson: BSON.AnyValue) throws
Attempts to cast the given variant value to a string, and then delegates to this type’s init(bson:)
witness.
init(bson: BSON.UTF8View<ArraySlice<UInt8>>) throws
Attempts to cast the given variant value to a string, and then delegates to this type’s init(_:)
witness.
import BSONEncoding
Implements the BSON encoding system.
protocol BSONEncodable
A type that can be encoded to a BSON variant value.
func encode(to field: inout BSON.FieldEncoder)
Encodes this string as a value of type string
.