Sign in

    moonbit-community/rtc/stun does not have a README file

    StunError

    pub(all) suberror StunError {
    InvalidMessage(String)
    IntegrityFailure
    UnknownRequiredAttribute(UInt16)
    TransactionTimedOut
    AgentClosed
    TransactionAlreadyExists
    TransactionNotFound
    CryptoUnavailable(String)
    } derive(Eq,
    Debug
    )

    Attribute

    pub struct Attribute {
    attribute_type : AttributeType
    value : Bytes
    padding : Bytes
    } derive(Eq,
    Debug
    )

    Attribute::as_network_cost

    fn Attribute::as_network_cost(self : Attribute) -> (UInt16, UInt16) raise StunError

    Attribute::as_text

    fn Attribute::as_text(self : Attribute) -> String raise StunError

    Attribute::as_u32

    fn Attribute::as_u32(self : Attribute) -> UInt raise StunError

    Attribute::as_u64

    fn Attribute::as_u64(self : Attribute) -> UInt64 raise StunError

    Attribute::attribute_type

    fn Attribute::attribute_type(self : Attribute) -> AttributeType

    Attribute::channel_number

    fn Attribute::channel_number(channel : UInt16) -> Attribute raise StunError

    Attribute::from_address

    Attribute::from_error

    fn Attribute::from_error(error : ResponseError) -> Attribute raise StunError

    Attribute::from_unknown_attributes

    fn Attribute::from_unknown_attributes(types : Array[UInt16]) -> Attribute raise StunError

    Attribute::from_xor_address

    fn Attribute::from_xor_address(address :
    SocketAddress
    , transaction_id : TransactionId, attribute_type? : AttributeType) -> Attribute raise StunError

    Attribute::ice_controlled

    fn Attribute::ice_controlled(value : UInt64) -> Attribute raise StunError

    Attribute::ice_controlling

    fn Attribute::ice_controlling(value : UInt64) -> Attribute raise StunError

    Attribute::lifetime

    fn Attribute::lifetime(seconds : UInt) -> Attribute raise StunError

    Attribute::network_cost

    fn Attribute::network_cost(network_id : UInt16, cost : UInt16) -> Attribute raise StunError

    Attribute::new

    fn Attribute::new(attribute_type~ : AttributeType, value~ : Bytes) -> Attribute raise StunError

    Attribute::nonce

    fn Attribute::nonce(value : String) -> Attribute raise StunError

    Attribute::priority

    fn Attribute::priority(value : UInt) -> Attribute raise StunError

    Attribute::realm

    fn Attribute::realm(value : String) -> Attribute raise StunError

    Attribute::software

    fn Attribute::software(value : String) -> Attribute raise StunError

    Attribute::to_error

    fn Attribute::to_error(self : Attribute) -> ResponseError raise StunError

    Attribute::to_unknown_attributes

    fn Attribute::to_unknown_attributes(self : Attribute) -> Array[UInt16] raise StunError

    Attribute::to_xor_address

    Attribute::use_candidate

    fn Attribute::use_candidate() -> Attribute raise StunError

    Attribute::username

    fn Attribute::username(value : String) -> Attribute raise StunError

    Attribute::value

    fn Attribute::value(self : Attribute) -> Bytes

    AttributeType

    pub(all) enum AttributeType {
    MappedAddress
    ChangeRequest
    SourceAddress
    ChangedAddress
    Username
    MessageIntegrity
    ErrorCode
    UnknownAttributes
    ChannelNumber
    Lifetime
    XorPeerAddress
    DataAttribute
    Realm
    Nonce
    XorRelayedAddress
    RequestedAddressFamily
    EvenPort
    RequestedTransport
    DontFragment
    MessageIntegritySha256
    PasswordAlgorithm
    Userhash
    XorMappedAddress
    ReservationToken
    Priority
    UseCandidate
    PaddingAttribute
    ResponsePort
    ConnectionId
    PasswordAlgorithms
    AlternateDomain
    Software
    AlternateServer
    CacheTimeout
    Fingerprint
    IceControlled
    IceControlling
    ResponseOrigin
    OtherAddress
    Origin
    NetworkCost
    UnknownAttribute(UInt16)
    } derive(Eq,
    Debug
    )

    AttributeType::code

    fn AttributeType::code(self : AttributeType) -> UInt16

    AttributeType::from_code

    fn AttributeType::from_code(code : UInt16) -> AttributeType

    AttributeType::is_comprehension_required

    fn AttributeType::is_comprehension_required(self : AttributeType) -> Bool

    Message

    pub struct Message {
    class : MessageClass
    stun_method : Method
    transaction_id : TransactionId
    attributes : Array[Attribute]
    } derive(Eq,
    Debug
    )

    Message::add_attribute

    fn Message::add_attribute(self : Message, attribute : Attribute) -> Unit

    Message::attributes

    fn Message::attributes(self : Message) -> Array[Attribute]

    Message::class

    fn Message::class(self : Message) -> MessageClass

    Message::decode

    fn Message::decode(data : Bytes) -> Message raise StunError

    Message::encode

    fn Message::encode(self : Message) -> Bytes raise StunError

    Message::encode_authenticated

    fn Message::encode_authenticated(self : Message, key : Bytes, sha256? : Bool, fingerprint? : Bool) -> Bytes raise StunError

    Message::error_response

    fn Message::error_response(request : Message, error : ResponseError) -> Message raise StunError

    Message::first_attribute

    fn Message::first_attribute(self : Message, attribute_type : AttributeType) -> Attribute?

    Message::is_stun

    fn Message::is_stun(data : Bytes) -> Bool

    Message::new

    fn Message::new(class~ : MessageClass, stun_method~ : Method, transaction_id~ : TransactionId, attributes? : Array[Attribute]) -> Message

    Message::stun_method

    fn Message::stun_method(self : Message) -> Method

    Message::transaction_id

    fn Message::transaction_id(self : Message) -> TransactionId

    Message::unknown_required_attributes

    fn Message::unknown_required_attributes(self : Message) -> Array[UInt16]

    Message::verify_fingerprint

    fn Message::verify_fingerprint(self : Message) -> Unit raise StunError

    Message::verify_integrity

    fn Message::verify_integrity(self : Message, key : Bytes, sha256? : Bool) -> Unit raise StunError

    MessageClass

    pub(all) enum MessageClass {
    Request
    Indication
    SuccessResponse
    ErrorResponse
    } derive(Eq,
    Debug
    )

    Method

    pub(all) enum Method {
    Binding
    Allocate
    Refresh
    Send
    Data
    CreatePermission
    ChannelBind
    Unknown(UInt16)
    } derive(Eq,
    Debug
    )

    ResponseError

    pub struct ResponseError {
    code : UInt16
    reason : String
    } derive(Eq,
    Debug
    )

    ResponseError::code

    fn ResponseError::code(self : ResponseError) -> UInt16

    ResponseError::new

    fn ResponseError::new(code~ : UInt16, reason~ : String) -> ResponseError raise StunError

    ResponseError::reason

    fn ResponseError::reason(self : ResponseError) -> String

    ResponseError::with_default_reason

    fn ResponseError::with_default_reason(code : UInt16) -> ResponseError raise StunError

    TransactionAgent

    pub struct TransactionAgent {
    transactions : Map[TransactionId,
    Instant
    ]
    events :
    Queue
    [TransactionEvent]
    closed : Bool
    }

    TransactionAgent::close

    fn TransactionAgent::close(self : TransactionAgent) -> Unit raise StunError

    TransactionAgent::collect

    TransactionAgent::is_closed

    fn TransactionAgent::is_closed(self : TransactionAgent) -> Bool

    TransactionAgent::new

    TransactionAgent::poll_event

    TransactionAgent::poll_timeout

    TransactionAgent::process

    fn TransactionAgent::process(self : TransactionAgent, message : Message) -> Unit raise StunError

    TransactionAgent::start

    TransactionAgent::stop

    fn TransactionAgent::stop(self : TransactionAgent, transaction_id : TransactionId) -> Unit raise StunError

    TransactionAgent::transaction_count

    fn TransactionAgent::transaction_count(self : TransactionAgent) -> Int

    TransactionEvent

    pub struct TransactionEvent {
    transaction_id : TransactionId
    event : TransactionEventKind
    } derive(Eq,
    Debug
    )

    TransactionEvent::event

    TransactionEvent::transaction_id

    fn TransactionEvent::transaction_id(self : TransactionEvent) -> TransactionId

    TransactionEventKind

    pub(all) enum TransactionEventKind {
    Received(Message)
    TimedOut
    Stopped
    Closed
    } derive(Eq,
    Debug
    )

    TransactionId

    pub struct TransactionId(Bytes) derive(Eq, Hash,
    Debug
    )

    TransactionId::as_bytes

    fn TransactionId::as_bytes(self : TransactionId) -> Bytes

    TransactionId::from_bytes

    fn TransactionId::from_bytes(value : Bytes) -> TransactionId raise StunError

    TransactionId::random

    fn TransactionId::random() -> TransactionId raise StunError

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io