pub struct UseCandidate {}
Expand description

The UseCandidate Attribute

Implementations§

Create a new UseCandidate Attribute

Examples
let _use_candidate = UseCandidate::new();
Examples found in repository?
src/stun/attribute.rs (line 1145)
1144
1145
1146
    fn default() -> Self {
        UseCandidate::new()
    }
More examples
Hide additional examples
src/conncheck.rs (line 171)
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
    fn generate_stun_request(
        conncheck: Arc<ConnCheck>,
        username: String,
        controlling: bool,
        tie_breaker: u64,
    ) -> Result<StunRequest, StunError> {
        let mut msg = Message::new_request(BINDING);

        // XXX: this needs to be the priority as if the candidate was peer-reflexive
        msg.add_attribute(Priority::new(conncheck.pair.local.priority))?;
        if controlling {
            msg.add_attribute(IceControlling::new(tie_breaker))?;
        } else {
            msg.add_attribute(IceControlled::new(tie_breaker))?;
        }
        if conncheck.nominate {
            msg.add_attribute(UseCandidate::new())?;
        }
        msg.add_attribute(Username::new(&username)?)?;
        msg.add_message_integrity(&conncheck.agent.local_credentials().unwrap())?;
        msg.add_fingerprint()?;

        let to = conncheck.pair.remote.address;
        conncheck.agent.stun_request_transaction(&msg, to)?.build()
    }

Trait Implementations§

Retrieve the AttributeType of an Attribute
Retrieve the length of an Attribute. This is not the padded length as stored in a Message
Convert an Attribute to a RawAttribute
Convert an Attribute from a RawAttribute
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more