#[non_exhaustive]pub struct StreamLayout {
pub payload_size: u64,
pub leader_size: u32,
pub trailer_size: u32,
pub payload_transfer_size: u32,
pub payload_transfer_count: u32,
pub final_transfer1_size: u32,
pub final_transfer2_size: u32,
}Expand description
How the host reads one block: the sizes it writes to the SIRM, and reads with.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.payload_size: u64Bytes of payload the device sends in one block.
leader_size: u32Bytes the host reads for a leader.
trailer_size: u32Bytes the host reads for a trailer.
payload_transfer_size: u32Bytes in each full payload transfer.
payload_transfer_count: u32Number of full payload transfers.
final_transfer1_size: u32Bytes in the first final transfer, 0 when there is none.
final_transfer2_size: u32Bytes in the second final transfer, 0 when there is none.
Implementations§
Source§impl StreamLayout
impl StreamLayout
Sourcepub fn new(
payload_size: u64,
required_leader_size: u32,
required_trailer_size: u32,
alignment: u32,
max_transfer: u32,
) -> Result<Self, U3vError>
pub fn new( payload_size: u64, required_leader_size: u32, required_trailer_size: u32, alignment: u32, max_transfer: u32, ) -> Result<Self, U3vError>
The layout for a block of payload_size bytes, every transfer a
multiple of alignment and none larger than max_transfer.
The USB3 Vision standard’s own rules are not freely available, so
this follows aravis (arv_uv_stream_start_acquisition): leader and
trailer are the required sizes aligned up, the payload goes in
transfers of up to max_transfer bytes, and the remainder in one
final transfer aligned up. Unlike aravis, the payload transfer size is
aligned down when the block is smaller than max_transfer, so no
transfer breaks the alignment the device asked for; the remainder
goes to the final transfer.
Sourcepub fn payload_capacity(&self) -> u64
pub fn payload_capacity(&self) -> u64
Bytes the payload transfers can hold.
Trait Implementations§
Source§impl Clone for StreamLayout
impl Clone for StreamLayout
impl Copy for StreamLayout
Source§impl Debug for StreamLayout
impl Debug for StreamLayout
impl Eq for StreamLayout
Source§impl PartialEq for StreamLayout
impl PartialEq for StreamLayout
impl StructuralPartialEq for StreamLayout
Auto Trait Implementations§
impl Freeze for StreamLayout
impl RefUnwindSafe for StreamLayout
impl Send for StreamLayout
impl Sync for StreamLayout
impl Unpin for StreamLayout
impl UnsafeUnpin for StreamLayout
impl UnwindSafe for StreamLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.