[−][src]Struct discortp::rtp::MutableRtpPacket
A structure enabling manipulation of on the wire packets
Methods
impl<'a> MutableRtpPacket<'a>
[src]
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableRtpPacket<'p>>
[src]
Constructs a new MutableRtpPacket. If the provided buffer is less than the minimum required packet size, this will return None.
pub fn owned(packet: Vec<u8>) -> Option<MutableRtpPacket<'static>>
[src]
Constructs a new MutableRtpPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the MutableRtpPacket will own its own data and the underlying buffer will be dropped when the MutableRtpPacket is.
pub fn to_immutable<'p>(&'p self) -> RtpPacket<'p>
[src]
Maps from a MutableRtpPacket to a RtpPacket
pub fn consume_to_immutable(self) -> RtpPacket<'a>
[src]
Maps from a MutableRtpPacket to a RtpPacket while consuming the source
pub const fn minimum_packet_size() -> usize
[src]
The minimum size (in bytes) a packet of this type can be. It's based on the total size of the fixed-size fields.
pub fn packet_size(_packet: &Rtp) -> usize
[src]
The size (in bytes) of a Rtp instance when converted into a byte-array
pub fn populate(&mut self, packet: &Rtp)
[src]
Populates a RtpPacket using a Rtp structure
pub fn get_version(&self) -> u2
[src]
Get the version field.
pub fn get_padding(&self) -> u1
[src]
Get the padding field.
pub fn get_extension(&self) -> u1
[src]
Get the extension field.
pub fn get_csrc_count(&self) -> u4
[src]
Get the csrc_count field.
pub fn get_marker(&self) -> u1
[src]
Get the marker field.
pub fn get_payload_type(&self) -> RtpType
[src]
Get the value of the payload_type field
pub fn get_sequence(&self) -> u16be
[src]
Get the sequence field. This field is always stored big-endian within the struct, but this accessor returns host order.
pub fn get_timestamp(&self) -> u32be
[src]
Get the timestamp field. This field is always stored big-endian within the struct, but this accessor returns host order.
pub fn get_ssrc(&self) -> u32be
[src]
Get the ssrc field. This field is always stored big-endian within the struct, but this accessor returns host order.
pub fn get_csrc_list_raw(&self) -> &[u8]
[src]
Get the raw &u8 value of the csrc_list field, without copying
pub fn get_csrc_list(&self) -> Vec<u32be>
[src]
Get the value of the csrc_list field (copies contents)
pub fn set_version(&mut self, val: u2)
[src]
Set the version field.
pub fn set_padding(&mut self, val: u1)
[src]
Set the padding field.
pub fn set_extension(&mut self, val: u1)
[src]
Set the extension field.
pub fn set_csrc_count(&mut self, val: u4)
[src]
Set the csrc_count field.
pub fn set_marker(&mut self, val: u1)
[src]
Set the marker field.
pub fn set_payload_type(&mut self, val: RtpType)
[src]
Set the value of the payload_type field.
pub fn set_sequence(&mut self, val: u16be)
[src]
Set the sequence field. This field is always stored big-endian within the struct, but this mutator wants host order.
pub fn set_timestamp(&mut self, val: u32be)
[src]
Set the timestamp field. This field is always stored big-endian within the struct, but this mutator wants host order.
pub fn set_ssrc(&mut self, val: u32be)
[src]
Set the ssrc field. This field is always stored big-endian within the struct, but this mutator wants host order.
pub fn get_csrc_list_raw_mut(&mut self) -> &mut [u8]
[src]
Get the raw &mut u8 value of the csrc_list field, without copying
pub fn set_csrc_list(&mut self, vals: &[u32be])
[src]
Set the value of the csrc_list field (copies contents)
pub fn set_payload(&mut self, vals: &[u8])
[src]
Set the value of the payload field (copies contents)
Trait Implementations
impl<'p> Debug for MutableRtpPacket<'p>
[src]
impl<'p> FromPacket for MutableRtpPacket<'p>
[src]
impl<'a> MutablePacket for MutableRtpPacket<'a>
[src]
fn packet_mut<'p>(&'p mut self) -> &'p mut [u8]
[src]
fn payload_mut<'p>(&'p mut self) -> &'p mut [u8]
[src]
fn clone_from<T>(&mut self, other: &T) where
T: Packet,
[src]
T: Packet,
impl<'a> Packet for MutableRtpPacket<'a>
[src]
impl<'a> PacketSize for MutableRtpPacket<'a>
[src]
fn packet_size(&self) -> usize
[src]
impl<'p> PartialEq<MutableRtpPacket<'p>> for MutableRtpPacket<'p>
[src]
fn eq(&self, other: &MutableRtpPacket<'p>) -> bool
[src]
fn ne(&self, other: &MutableRtpPacket<'p>) -> bool
[src]
impl<'p> StructuralPartialEq for MutableRtpPacket<'p>
[src]
Auto Trait Implementations
impl<'p> RefUnwindSafe for MutableRtpPacket<'p>
impl<'p> Send for MutableRtpPacket<'p>
impl<'p> Sync for MutableRtpPacket<'p>
impl<'p> Unpin for MutableRtpPacket<'p>
impl<'p> !UnwindSafe for MutableRtpPacket<'p>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,