MoonBit bindings for libsoup 3.0 (HTTP client, WebSocket)
Dependencies
tonyfettes/soup does not have a README file
pub(open) trait IMessage {
fn as_message(Self) -> Message
fn add_flags(Self, MessageFlags) -> Unit = _
fn get_connection_id(Self) -> UInt64 = _
fn get_first_party(Self) -> Uri = _
fn get_flags(Self) -> MessageFlags = _
fn get_force_http1(Self) -> Bool = _
fn get_http_version(Self) -> HTTPVersion = _
fn get_is_options_ping(Self) -> Bool = _
fn get_is_top_level_navigation(Self) -> Bool = _
fn get_method(Self) -> String = _
fn get_priority(Self) -> MessagePriority = _
fn get_reason_phrase(Self) -> String? = _
fn get_remote_address(Self) -> SocketAddress? = _
fn get_site_for_cookies(Self) -> Uri = _
fn get_status(Self) -> Status = _
fn get_tls_ciphersuite_name(Self) -> String = _
fn get_tls_peer_certificate(Self) -> TlsCertificate? = _
fn get_tls_peer_certificate_errors(Self) -> TlsCertificateFlags = _
fn get_tls_protocol_version(Self) -> TlsProtocolVersion = _
fn get_uri(Self) -> Uri = _
fn is_keepalive(Self) -> Bool = _
fn query_flags(Self, MessageFlags) -> Bool = _
fn remove_flags(Self, MessageFlags) -> Unit = _
fn set_first_party(Self, Uri) -> Unit = _
fn set_flags(Self, MessageFlags) -> Unit = _
fn set_force_http1(Self, Bool) -> Unit = _
fn set_is_options_ping(Self, Bool) -> Unit = _
fn set_is_top_level_navigation(Self, Bool) -> Unit = _
fn set_method(Self, String) -> Unit = _
fn set_priority(Self, MessagePriority) -> Unit = _
fn set_request_body(Self, String?, &IInputStream?, Int64) -> Unit = _
fn set_request_body_from_bytes(Self, String?, Bytes) -> Unit = _
fn set_site_for_cookies(Self, Uri?) -> Unit = _
fn set_tls_client_certificate(Self, &ITlsCertificate?) -> Unit = _
fn set_uri(Self, Uri) -> Unit = _
fn tls_client_certificate_password_request_complete(Self) -> Unit = _
fn connect_accept_certificate(Self, (Message, TlsCertificate, TlsCertificateFlags) -> Bool) -> UInt64 = _
fn connect_finished(Self, (Message) -> Unit) -> UInt64 = _
fn connect_got_body(Self, (Message) -> Unit) -> UInt64 = _
fn connect_got_body_data(Self, (Message, UInt) -> Unit) -> UInt64 = _
fn connect_got_headers(Self, (Message) -> Unit) -> UInt64 = _
fn connect_got_informational(Self, (Message) -> Unit) -> UInt64 = _
fn connect_hsts_enforced(Self, (Message) -> Unit) -> UInt64 = _
fn connect_network_event(Self, (Message, SocketClientEvent, IOStream) -> Unit) -> UInt64 = _
fn connect_request_certificate(Self, (Message, TlsClientConnection) -> Bool) -> UInt64 = _
fn connect_request_certificate_password(Self, (Message, TlsPassword) -> Bool) -> UInt64 = _
fn connect_restarted(Self, (Message) -> Unit) -> UInt64 = _
fn connect_starting(Self, (Message) -> Unit) -> UInt64 = _
fn connect_wrote_body(Self, (Message) -> Unit) -> UInt64 = _
fn connect_wrote_body_data(Self, (Message, UInt) -> Unit) -> UInt64 = _
fn connect_wrote_headers(Self, (Message) -> Unit) -> UInt64 = _
}pub(open) trait IMultipartInputStream {
fn as_multipart_input_stream(Self) -> MultipartInputStream
fn next_part(Self, &ICancellable?) -> InputStream? raise Error_ = _
fn next_part_async(Self, Int, &ICancellable?, (Result[InputStream?, Error_]) -> Unit) -> Unit = _
}pub(open) trait IServer {
fn as_server(Self) -> Server
fn accept_iostream(Self, &IIOStream, &ISocketAddress?, &ISocketAddress?) -> Bool raise Error_ = _
fn disconnect(Self) -> Unit = _
fn get_tls_auth_mode(Self) -> TlsAuthenticationMode = _
fn get_tls_certificate(Self) -> TlsCertificate? = _
fn get_tls_database(Self) -> TlsDatabase? = _
fn get_uris(Self) -> Array[Uri] = _
fn is_https(Self) -> Bool = _
fn listen(Self, &ISocketAddress, ServerListenOptions) -> Bool raise Error_ = _
fn listen_all(Self, UInt, ServerListenOptions) -> Bool raise Error_ = _
fn listen_local(Self, UInt, ServerListenOptions) -> Bool raise Error_ = _
fn remove_handler(Self, String) -> Unit = _
fn set_tls_auth_mode(Self, TlsAuthenticationMode) -> Unit = _
fn set_tls_certificate(Self, &ITlsCertificate) -> Unit = _
fn set_tls_database(Self, &ITlsDatabase) -> Unit = _
fn connect_request_aborted(Self, (Server, ServerMessage) -> Unit) -> UInt64 = _
fn connect_request_finished(Self, (Server, ServerMessage) -> Unit) -> UInt64 = _
fn connect_request_read(Self, (Server, ServerMessage) -> Unit) -> UInt64 = _
fn connect_request_started(Self, (Server, ServerMessage) -> Unit) -> UInt64 = _
fn add_early_handler(Self, String?, (Server, ServerMessage, String, Map[String, String]?) -> Unit) -> Unit = _
fn add_handler(Self, String?, (Server, ServerMessage, String, Map[String, String]?) -> Unit) -> Unit = _
fn add_websocket_handler(Self, String?, String?, Array[String]?, (Server, ServerMessage, String, WebsocketConnection) -> Unit) -> Unit = _
}pub(open) trait IServerMessage {
fn as_server_message(Self) -> ServerMessage
fn get_http_version(Self) -> HTTPVersion = _
fn get_local_address(Self) -> SocketAddress? = _
fn get_method(Self) -> String = _
fn get_reason_phrase(Self) -> String? = _
fn get_remote_address(Self) -> SocketAddress? = _
fn get_remote_host(Self) -> String? = _
fn get_status(Self) -> UInt = _
fn get_tls_peer_certificate(Self) -> TlsCertificate? = _
fn get_tls_peer_certificate_errors(Self) -> TlsCertificateFlags = _
fn get_uri(Self) -> Uri = _
fn is_options_ping(Self) -> Bool = _
fn pause(Self) -> Unit = _
fn set_http_version(Self, HTTPVersion) -> Unit = _
fn set_redirect(Self, UInt, String) -> Unit = _
fn set_status(Self, UInt, String?) -> Unit = _
fn steal_connection(Self) -> IOStream = _
fn unpause(Self) -> Unit = _
fn connect_accept_certificate(Self, (ServerMessage, TlsCertificate, TlsCertificateFlags) -> Bool) -> UInt64 = _
fn connect_connected(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_disconnected(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_finished(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_got_body(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_got_chunk(Self, (ServerMessage, Bytes) -> Unit) -> UInt64 = _
fn connect_got_headers(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_wrote_body(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_wrote_body_data(Self, (ServerMessage, UInt) -> Unit) -> UInt64 = _
fn connect_wrote_chunk(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_wrote_headers(Self, (ServerMessage) -> Unit) -> UInt64 = _
fn connect_wrote_informational(Self, (ServerMessage) -> Unit) -> UInt64 = _
}pub(open) trait ISession {
fn as_session(Self) -> Session
fn abort(Self) -> Unit = _
fn add_feature(Self, &ISessionFeature) -> Unit = _
fn get_accept_language(Self) -> String? = _
fn get_accept_language_auto(Self) -> Bool = _
fn get_async_result_message(Self, &IAsyncResult) -> Message? = _
fn get_idle_timeout(Self) -> UInt = _
fn get_local_address(Self) -> InetSocketAddress? = _
fn get_max_conns(Self) -> UInt = _
fn get_max_conns_per_host(Self) -> UInt = _
fn get_proxy_resolver(Self) -> ProxyResolver? = _
fn get_remote_connectable(Self) -> SocketConnectable? = _
fn get_timeout(Self) -> UInt = _
fn get_tls_database(Self) -> TlsDatabase? = _
fn get_tls_interaction(Self) -> TlsInteraction? = _
fn get_user_agent(Self) -> String? = _
fn remove_feature(Self, &ISessionFeature) -> Unit = _
fn send(Self, &IMessage, &ICancellable?) -> InputStream raise Error_ = _
fn send_and_read(Self, &IMessage, &ICancellable?) -> Bytes raise Error_ = _
fn send_and_splice(Self, &IMessage, &IOutputStream, OutputStreamSpliceFlags, &ICancellable?) -> Int64 raise Error_ = _
fn set_accept_language(Self, String) -> Unit = _
fn set_accept_language_auto(Self, Bool) -> Unit = _
fn set_idle_timeout(Self, UInt) -> Unit = _
fn set_proxy_resolver(Self, &IProxyResolver?) -> Unit = _
fn set_timeout(Self, UInt) -> Unit = _
fn set_tls_database(Self, &ITlsDatabase?) -> Unit = _
fn set_tls_interaction(Self, &ITlsInteraction?) -> Unit = _
fn set_user_agent(Self, String) -> Unit = _
fn connect_request_queued(Self, (Session, Message) -> Unit) -> UInt64 = _
fn connect_request_unqueued(Self, (Session, Message) -> Unit) -> UInt64 = _
fn preconnect_async(Self, &IMessage, Int, &ICancellable?, (Result[Bool, Error_]) -> Unit) -> Unit = _
fn send_and_read_async(Self, &IMessage, Int, &ICancellable?, (Result[Bytes, Error_]) -> Unit) -> Unit = _
fn send_and_splice_async(Self, &IMessage, &IOutputStream, OutputStreamSpliceFlags, Int, &ICancellable?, (Result[Int64, Error_]) -> Unit) -> Unit = _
fn send_async(Self, &IMessage, Int, &ICancellable?, (Result[InputStream, Error_]) -> Unit) -> Unit = _
fn websocket_connect_async(Self, &IMessage, String?, Array[String]?, Int, &ICancellable?, (Result[WebsocketConnection, Error_]) -> Unit) -> Unit = _
}pub(open) trait IWebsocketConnection {
fn as_websocket_connection(Self) -> WebsocketConnection
fn close(Self, UInt, String?) -> Unit = _
fn get_close_code(Self) -> UInt = _
fn get_close_data(Self) -> String = _
fn get_connection_type(Self) -> WebsocketConnectionType = _
fn get_io_stream(Self) -> IOStream = _
fn get_keepalive_interval(Self) -> UInt = _
fn get_keepalive_pong_timeout(Self) -> UInt = _
fn get_max_incoming_payload_size(Self) -> UInt64 = _
fn get_origin(Self) -> String? = _
fn get_protocol(Self) -> String? = _
fn get_state(Self) -> WebsocketState = _
fn get_uri(Self) -> Uri = _
fn send_message(Self, WebsocketDataType, Bytes) -> Unit = _
fn send_text(Self, String) -> Unit = _
fn set_keepalive_interval(Self, UInt) -> Unit = _
fn set_keepalive_pong_timeout(Self, UInt) -> Unit = _
fn set_max_incoming_payload_size(Self, UInt64) -> Unit = _
fn connect_closed(Self, (WebsocketConnection) -> Unit) -> UInt64 = _
fn connect_closing(Self, (WebsocketConnection) -> Unit) -> UInt64 = _
fn connect_message(Self, (WebsocketConnection, Int, Bytes) -> Unit) -> UInt64 = _
fn connect_pong(Self, (WebsocketConnection, Bytes) -> Unit) -> UInt64 = _
}pub(open) trait VServerRequestFinished {
fn request_finished(Self, Server, &IServerMessage) -> Unit
}pub struct Cacheability {
// private fields
}pub(all) enum CacheabilityFlag {
Cacheable
Uncacheable
Invalidates
Validates
}pub(all) enum Encoding {
Unrecognized
None
ContentLength
Eof
Chunked
Byteranges
}pub type Messagefn Message::connect_accept_certificate(self : Message, f : (Message, TlsCertificate, TlsCertificateFlags) -> Bool) -> UInt64fn Message::connect_network_event(self : Message, f : (Message, SocketClientEvent, IOStream) -> Unit) -> UInt64fn Message::connect_request_certificate(self : Message, f : (Message, TlsClientConnection) -> Bool) -> UInt64fn Message::connect_request_certificate_password(self : Message, f : (Message, TlsPassword) -> Bool) -> UInt64fn Message::set_request_body(self : Message, content_type : String?, stream : &IInputStream?, content_length : Int64) -> Unitpub(all) enum MessageFlag {
NoRedirect
NewConnection
Idempotent
DoNotUseAuthCache
CollectMetrics
}pub struct MessageFlags {
// private fields
}pub(all) enum MessagePriority {
VeryLow
Low
Normal
High
VeryHigh
}pub type MultipartInputStreamimpl IInputStream for MultipartInputStreamimpl IObject for MultipartInputStreamfn MultipartInputStream::next_part(self : MultipartInputStream, cancellable : &ICancellable?) -> InputStream? raise Error_fn MultipartInputStream::next_part_async(self : MultipartInputStream, io_priority : Int, cancellable : &ICancellable?, callback : (Result[InputStream?, Error_]) -> Unit) -> Unitpub type Serverfn Server::accept_iostream(self : Server, stream : &IIOStream, local_addr : &ISocketAddress?, remote_addr : &ISocketAddress?) -> Bool raise Error_fn Server::add_early_handler(self : Server, path : String?, callback : (Server, ServerMessage, String, Map[String, String]?) -> Unit) -> Unitfn Server::add_handler(self : Server, path : String?, callback : (Server, ServerMessage, String, Map[String, String]?) -> Unit) -> Unitfn Server::add_websocket_handler(self : Server, path : String?, origin : String?, protocols : Array[String]?, callback : (Server, ServerMessage, String, WebsocketConnection) -> Unit) -> Unitfn Server::listen(self : Server, address : &ISocketAddress, options : ServerListenOptions) -> Bool raise Error_fn Server::listen_all(self : Server, port : UInt, options : ServerListenOptions) -> Bool raise Error_fn Server::listen_local(self : Server, port : UInt, options : ServerListenOptions) -> Bool raise Error_pub(all) enum ServerListenOption {
Https
Ipv4Only
Ipv6Only
}pub struct ServerListenOptions {
// private fields
}fn ServerListenOptions::ServerListenOptions(flags : Array[ServerListenOption]) -> ServerListenOptionspub type ServerMessageimpl IObject for ServerMessageimpl IServerMessage for ServerMessagefn ServerMessage::connect_accept_certificate(self : ServerMessage, f : (ServerMessage, TlsCertificate, TlsCertificateFlags) -> Bool) -> UInt64fn ServerMessage::connect_got_chunk(self : ServerMessage, f : (ServerMessage, Bytes) -> Unit) -> UInt64fn ServerMessage::connect_wrote_body_data(self : ServerMessage, f : (ServerMessage, UInt) -> Unit) -> UInt64fn ServerMessage::connect_wrote_headers(self : ServerMessage, f : (ServerMessage) -> Unit) -> UInt64fn ServerMessage::connect_wrote_informational(self : ServerMessage, f : (ServerMessage) -> Unit) -> UInt64fn ServerMessage::set_redirect(self : ServerMessage, status_code : UInt, redirect_uri : String) -> Unitfn ServerMessage::set_response(self : ServerMessage, content_type : String?, body : String?) -> Unitfn ServerMessage::set_status(self : ServerMessage, status_code : UInt, reason_phrase : String?) -> Unitpub type Sessionfn Session::preconnect_async(self : Session, msg : &IMessage, io_priority : Int, cancellable : &ICancellable?, callback : (Result[Bool, Error_]) -> Unit) -> Unitfn Session::send(self : Session, msg : &IMessage, cancellable : &ICancellable?) -> InputStream raise Error_fn Session::send_and_read(self : Session, msg : &IMessage, cancellable : &ICancellable?) -> Bytes raise Error_fn Session::send_and_read_async(self : Session, msg : &IMessage, io_priority : Int, cancellable : &ICancellable?, callback : (Result[Bytes, Error_]) -> Unit) -> Unitfn Session::send_and_splice(self : Session, msg : &IMessage, out_stream : &IOutputStream, flags : OutputStreamSpliceFlags, cancellable : &ICancellable?) -> Int64 raise Error_fn Session::send_and_splice_async(self : Session, msg : &IMessage, out_stream : &IOutputStream, flags : OutputStreamSpliceFlags, io_priority : Int, cancellable : &ICancellable?, callback : (Result[Int64, Error_]) -> Unit) -> Unitfn Session::send_async(self : Session, msg : &IMessage, io_priority : Int, cancellable : &ICancellable?, callback : (Result[InputStream, Error_]) -> Unit) -> Unitfn Session::websocket_connect_async(self : Session, msg : &IMessage, origin : String?, protocols : Array[String]?, io_priority : Int, cancellable : &ICancellable?, callback : (Result[WebsocketConnection, Error_]) -> Unit) -> Unitpub(all) enum SessionError {
Parsing
Encoding
TooManyRedirects
TooManyRestarts
RedirectNoLocation
RedirectBadUri
MessageAlreadyInQueue
}pub(all) enum Status {
None
Continue
SwitchingProtocols
Processing
Ok
Created
Accepted
NonAuthoritative
NoContent
ResetContent
PartialContent
MultiStatus
MultipleChoices
MovedPermanently
Found
SeeOther
NotModified
UseProxy
NotAppearingInThisProtocol
TemporaryRedirect
PermanentRedirect
BadRequest
Unauthorized
PaymentRequired
Forbidden
NotFound
MethodNotAllowed
NotAcceptable
ProxyAuthenticationRequired
RequestTimeout
Conflict
Gone
LengthRequired
PreconditionFailed
RequestEntityTooLarge
RequestUriTooLong
UnsupportedMediaType
RequestedRangeNotSatisfiable
ExpectationFailed
MisdirectedRequest
UnprocessableEntity
Locked
FailedDependency
InternalServerError
NotImplemented
BadGateway
ServiceUnavailable
GatewayTimeout
HttpVersionNotSupported
InsufficientStorage
NotExtended
}pub(all) enum WebsocketCloseCode {
Normal
GoingAway
ProtocolError
UnsupportedData
NoStatus
Abnormal
BadData
PolicyViolation
TooBig
NoExtension
ServerError
TlsHandshake
}pub type WebsocketConnectionimpl IObject for WebsocketConnectionimpl IWebsocketConnection for WebsocketConnectionfn WebsocketConnection::connect_closed(self : WebsocketConnection, f : (WebsocketConnection) -> Unit) -> UInt64fn WebsocketConnection::connect_closing(self : WebsocketConnection, f : (WebsocketConnection) -> Unit) -> UInt64fn WebsocketConnection::connect_message(self : WebsocketConnection, f : (WebsocketConnection, Int, Bytes) -> Unit) -> UInt64fn WebsocketConnection::connect_pong(self : WebsocketConnection, f : (WebsocketConnection, Bytes) -> Unit) -> UInt64fn WebsocketConnection::send_message(self : WebsocketConnection, type_ : WebsocketDataType, message : Bytes) -> Unitfn WebsocketConnection::set_keepalive_pong_timeout(self : WebsocketConnection, pong_timeout : UInt) -> Unitfn WebsocketConnection::set_max_incoming_payload_size(self : WebsocketConnection, max_incoming_payload_size : UInt64) -> Unitpub(all) enum WebsocketConnectionType {
Unknown
Client
Server
}pub(all) enum WebsocketError {
Failed
NotWebsocket
BadHandshake
BadOrigin
}MoonBit bindings for libsoup 3.0 (HTTP client, WebSocket)
Dependencies