Struct ogg::writing::PacketWriter

source ·
pub struct PacketWriter<'writer, T: Write> { /* private fields */ }
Expand description

Writer for packets into an Ogg stream.

Note that the functionality of this struct isn’t as well tested as for the PacketReader struct.

Implementations§

source§

impl<'writer, T: Write> PacketWriter<'writer, T>

source

pub fn new(wtr: T) -> Self

source

pub fn into_inner(self) -> T

source

pub fn inner(&self) -> &T

Access the interior writer

This allows access of the writer contained inside. No guarantees are given onto the pattern of the writes. They may change in the future.

source

pub fn inner_mut(&mut self) -> &mut T

Access the interior writer mutably

This allows access of the writer contained inside. No guarantees are given onto the pattern of the writes. They may change in the future.

source

pub fn write_packet<P: Into<Cow<'writer, [u8]>>>( &mut self, pck_cont: P, serial: u32, inf: PacketWriteEndInfo, absgp: u64 ) -> Result<(), Error>

Write a packet

source§

impl<T: Seek + Write> PacketWriter<'_, T>

source

pub fn get_current_offs(&mut self) -> Result<u64, Error>

Auto Trait Implementations§

§

impl<'writer, T> RefUnwindSafe for PacketWriter<'writer, T>
where T: RefUnwindSafe,

§

impl<'writer, T> Send for PacketWriter<'writer, T>
where T: Send,

§

impl<'writer, T> Sync for PacketWriter<'writer, T>
where T: Sync,

§

impl<'writer, T> Unpin for PacketWriter<'writer, T>
where T: Unpin,

§

impl<'writer, T> UnwindSafe for PacketWriter<'writer, T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.