VISADecodable
public protocol VISADecodable
A type that can be decoded from a NI-VISA ASCII message.
-
The default decoder type to use when decoding.
Declaration
Swift
associatedtype DefaultVISADecoder : VISADecoder where Self == Self.DefaultVISADecoder.DecodingType
-
The defualt decoder to use when decoding.
Declaration
Swift
static var defaultVISADecoder: DefaultVISADecoder { get }
-
decode(visaString:with:)
Extension methodDecodes the NI-VISA ASCII message using the given decoder.
Throws
If the value could not be decoded.Declaration
Swift
public func decode<D>(visaString string: String, with decoder: D) throws -> Self where Self == D.DecodingType, D : VISADecoder
Parameters
string
The ASCII message to decode.
decoder
The decoder to use.
Return Value
The decoded value.
-
decode(visaString:)
Extension methodDecodes the NI-VISA ASCII message using the default decoder for this type.
Throws
If the value could not be decoded.Declaration
Swift
public func decode(visaString string: String) throws -> Self
Parameters
string
The ASCII message to decode.
Return Value
The decoded value.
-
init(visaString:decoder:)
Extension methodCreates a new value by decoding a NI-VISA ASCII message using the given decoder.
Throws
If the value could not be decoded.bDeclaration
Swift
public init<D>(visaString string: String, decoder: D) throws where Self == D.DecodingType, D : VISADecoder
Parameters
string
The ASCII message to decode.
decoder
The decoder to use.
Return Value
The decoded value.
-
init(visaString:)
Extension methodCreates a new value by decoding a NI-VISA ASCCI message using the default decoder.
Throws
If the value could not be decoded.Declaration
Swift
public init(visaString string: String) throws
Parameters
string
The ASCII message to decode.