pub struct ChangeRequest(/* private fields */);
Expand description
The change request attribute contains two flags to control the IP address and port that the server uses to send the response. These flags are called the “change IP” and “change port” flags. This attribute is allowed only in the Binding Request. The “change IP” and “change port” flags are useful for determining the current filtering behavior of a NAT. They instruct the server to send the Binding Responses from the alternate source IP address and/or alternate port. The change request attribute is optional in the Binding Request.
§Example
let change_request = ChangeRequest::new(Some(ChangeIp | ChangePort));
assert!(change_request.flags().contains(ChangeIp));
assert!(change_request.flags().contains(ChangePort));
Implementations§
source§impl ChangeRequest
impl ChangeRequest
sourcepub fn new(flags: Option<BitFlags<ChangeRequestFlags>>) -> Self
pub fn new(flags: Option<BitFlags<ChangeRequestFlags>>) -> Self
sourcepub fn flags(&self) -> BitFlags<ChangeRequestFlags>
pub fn flags(&self) -> BitFlags<ChangeRequestFlags>
Returns the flags set in the change request attribute
Trait Implementations§
source§impl Clone for ChangeRequest
impl Clone for ChangeRequest
source§fn clone(&self) -> ChangeRequest
fn clone(&self) -> ChangeRequest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChangeRequest
impl Debug for ChangeRequest
source§impl From<ChangeRequest> for StunAttribute
impl From<ChangeRequest> for StunAttribute
source§fn from(value: ChangeRequest) -> Self
fn from(value: ChangeRequest) -> Self
Converts to this type from the input type.
source§impl StunAttributeType for ChangeRequest
impl StunAttributeType for ChangeRequest
source§fn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
source§fn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Copy for ChangeRequest
Auto Trait Implementations§
impl Freeze for ChangeRequest
impl RefUnwindSafe for ChangeRequest
impl Send for ChangeRequest
impl Sync for ChangeRequest
impl Unpin for ChangeRequest
impl UnwindSafe for ChangeRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)