DatasyncState
public struct DatasyncState : Codable, Equatable, CustomStringConvertible, CustomDebugStringConvertible
A value used to represent the state of the web socket opened by a DatasyncService instance.
-
A value representing the connection state of the web socket.
See moreDeclaration
Swift
@frozen public enum ConnectionState : Codable, Equatable, CustomStringConvertible
-
Indicates that the back-end can be reached with the current network configuration.
Declaration
Swift
public let isReachable: Bool -
The connection state of the web socket.
Declaration
Swift
public let connectionState: ConnectionState -
The authentication state of the web socket.
While the web socket remains in the
AuthenticationState.invalidstate, all Datasync operations are suspended until the web socket goes to theAuthenticationState.unauthenticatedor to theAuthenticationState.authenticated(details:)state. At that time, these operations are flushed to the back-end, which may accept or reject each of them, depending on the corresponding security rules and the authentication token.Declaration
Swift
public let authenticationState: AuthenticationState
-
Creates a new value with an unreachable, disconnected and unauthenticated state.
Declaration
Swift
public init() -
Declaration
Swift
public init(from decoder: Decoder) throws
-
Indicates whether the web socket is connected.
This property is
trueif and only if theconnectionStateproperty matches theConnectionState.connected(backEndTimeOffsetMS:)case.Declaration
Swift
public var isConnected: Bool { get } -
Indicates whether the web socket is initializing.
This property is
trueif and only if theconnectionStateproperty matches theConnectionState.disconnected(backEndTimeOffsetMS: _, isInitializing: true)case.Declaration
Swift
public var isInitializing: Bool { get } -
Indicates whether there is currently a valid authentication token on the web socket.
This property is
trueif and only if theauthenticationStateproperty matches theAuthenticationState.authenticated(details:)case.Declaration
Swift
public var isAuthenticated: Bool { get } -
The authentication details of the user currently authenticated on the web socket.
This property is
nilwhen there is currently no valid authentication token on the web socket, i.e. when theauthenticationStateproperty does not match theAuthenticationState.authenticated(details:)case.Declaration
Swift
public var authenticationDetails: AuthenticationDetails? { get }
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }