pub fn new<B>(stream: &'a mut impl WriteBytes, boxinfo: &B) -> io::Result<BoxWriter<'a>>
    where
        B: BoxInfo + FullBox,
    {
        let offset = stream.pos();
        0u32.to_bytes(stream)?;
        boxinfo.fourcc().to_bytes(stream)?;
        let mut vflags = 0;
        if B::max_version().is_some() {
            let version = boxinfo.version().unwrap_or(0) as u32;
            vflags = version << 24 | boxinfo.flags();
            vflags.to_bytes(stream)?;
        }
        Ok(BoxWriter {
            offset,
            vflags,
            finalized: false,
            inner: Box::new(stream),
        })
    }
/// Write a provisional box header, then return a new stream. When
/// the stream is dropped, the box header is updated.
Write a provisional box header, then return a new stream. When
the stream is dropped, the box header is updated.
Write a provisional box header then return a new stream . When the stream is dropped the box header is updated .
pub fn new<B>(stream: &'a mut impl WriteBytes, boxinfo: &B) -> io::Result<BoxWriter<'a>>
    where
        B: BoxInfo + FullBox,
    {
        let offset = stream.pos();
        0u32.to_bytes(stream)?;
        boxinfo.fourcc().to_bytes(stream)?;
        let mut vflags = 0;
        if B::max_version().is_some() {
            let version = boxinfo.version().unwrap_or(0) as u32;
            vflags = version << 24 | boxinfo.flags();
            vflags.to_bytes(stream)?;
        }
        Ok(BoxWriter {
            offset,
            vflags,
            finalized: false,
            inner: Box::new(stream),
        })
    }
pub fn new < B > ( stream : & ' a mut impl WriteBytes , boxinfo : & B ) -> io :: Result < BoxWriter < ' a > > where B : BoxInfo + FullBox , { let offset = stream . pos ( ) ; 0u32 . to_bytes ( stream ) ? ; boxinfo . fourcc ( ) . to_bytes ( stream ) ? ; let mut vflags = 0 ; if B :: max_version ( ) . is_some ( ) { let version = boxinfo . version ( ) . unwrap_or ( 0 ) as u32 ; vflags = version << 24 | boxinfo . flags ( ) ; vflags . to_bytes ( stream ) ? ; } Ok ( BoxWriter { offset , vflags , finalized : false , inner : Box :: new ( stream ) , } ) }
Write a provisional box header, then return a new stream.
Write a provisional box header then return a new stream .
stream
&'a mut impl WriteBytes
boxinfo
&B
stream
&'a mut impl WriteBytes
boxinfo
&B