DefaultVISAOptionalDecoder

public struct DefaultVISAOptionalDecoder<W> : VISADecoder where W : VISADecodable

The default VISADecoder for Optional<T>.

This supports any type T? where T conforms to VISADecodable.

This decoder tries to convert the ASCII message into an optional.

  • Declaration

    Swift

    public typealias DecodingType = W?
  • Decodes the NI-VISA ASCII message into an optional.

    Throws

    If the message could not be converted to an optional.

    Declaration

    Swift

    public func decode(_ string: String) throws -> W?

    Parameters

    string

    The ASCII message returned from the instrument.

    Return Value

    The message converted to an optional.