TDJsonClient
public class TDJsonClient
This is a wrapper around TDJSON.
It is responsible for creating a C td_json_client, sending request and receiving it’s updates.
The update data can be accessed by subscribing to TDJsonClient.stream.
It is recommended to let the Coordinator manage the TDJsonClient and to never to use TDJsonClient directly.
-
The log verbosity level of the
See moretdlib.Declaration
Swift
public enum LogLevel : Int32 -
The raw C
td_json_client. It is recommended to use it.Declaration
Swift
public let rawClient: UnsafeMutableRawPointer -
Whether the object is still receiving data from
tdjson.Declaration
Swift
public private(set) var isListing: Bool -
Undocumented
Declaration
Swift
public var isRunning: Bool -
Sets the log verbosity level of the
tdlib.Declaration
Swift
public var logLevel: TDJsonClient.LogLevel { get set } -
Undocumented
Declaration
Swift
public var logPath: String? { get set } -
Initiates a new
TDJsonClient, that immediately starts receiving data fromtdlib.Declaration
Swift
public init() -
Sends a request to
tdlib. TheJSONDecoder.tdwill be used to encode the json. Use@extrato later identify the response.Throws
An error if something goes wrong during the encoding.Declaration
Swift
public func send<T>(_ encodable: T) throws where T : EncodableParameters
encodableA
encodablerequest object. -
Send a request to
tdlib. Use@extrato later identify the response.Declaration
Swift
public func send(_ query: String)Parameters
queryA json encoded request.
-
Executes a request synchronously. Can only be used for certain request.
Declaration
Swift
public func execute(_ query: String) -> String?Parameters
queryA json encoded request
Return Value
The result of the request, or nil.
-
Stops receiving data from
tdliband destroys thetd_json_client.Declaration
Swift
public func close()
View on GitHub
Install in Dash
TDJsonClient Class Reference