Skip to main content

SnapReader

Struct SnapReader 

Source
pub struct SnapReader<'a> {
    pub ok: bool,
    /* private fields */
}
Expand description

Bounds-checked read cursor for snapshot images. (b3SnapReader)

Fields§

§ok: bool

Implementations§

Source§

impl<'a> SnapReader<'a>

Source

pub fn new(data: &'a [u8]) -> Self

Source

pub fn cursor(&self) -> usize

Source

pub fn set_cursor(&mut self, cursor: usize)

Source

pub fn bytes(&mut self, n: usize) -> Option<&'a [u8]>

Source

pub fn copy_bytes(&mut self, dst: &mut [u8])

Source

pub fn u8(&mut self) -> u8

Source

pub fn u16(&mut self) -> u16

Source

pub fn u32(&mut self) -> u32

Source

pub fn u64(&mut self) -> u64

Source

pub fn i32(&mut self) -> i32

Source

pub fn f32(&mut self) -> f32

Source

pub fn f64(&mut self) -> f64

Source

pub fn bool(&mut self) -> bool

Source

pub fn vec3(&mut self) -> Vec3

Source

pub fn quat(&mut self) -> Quat

Source

pub fn transform(&mut self) -> Transform

Source

pub fn pos(&mut self) -> Pos

Source

pub fn world_xf(&mut self) -> WorldTransform

Source

pub fn matrix3(&mut self) -> Matrix3

Source

pub fn aabb(&mut self) -> Aabb

Source

pub fn sphere(&mut self) -> Sphere

Source

pub fn capsule(&mut self) -> Capsule

Source

pub fn filter(&mut self) -> Filter

Source

pub fn material(&mut self) -> SurfaceMaterial

Source

pub fn check_count( &self, count: i32, mem_size: i32, min_stream_bytes: i32, ) -> bool

Bounds check before allocating from image. (b3SnapCheckCount)

Source§

impl SnapReader<'_>

Source

pub fn vec2(&mut self) -> Vec2

Source

pub fn softness(&mut self) -> Softness

Source§

impl<'a> SnapReader<'a>

Source

pub fn u24(&mut self) -> u32

Source

pub fn str_owned(&mut self) -> String

(b3RecR_STR) — empty string for the 0xFFFF null sentinel.

Source

pub fn body_str(&mut self) -> String

Source

pub fn shape_str(&mut self) -> String

Source

pub fn world_id(&mut self) -> WorldId

Source

pub fn body_id(&mut self) -> BodyId

Source

pub fn shape_id(&mut self) -> ShapeId

Source

pub fn joint_id(&mut self) -> JointId

Source

pub fn mass_data(&mut self) -> MassData

Source

pub fn locks(&mut self) -> MotionLocks

Source

pub fn query_filter(&mut self) -> QueryFilter

Source

pub fn shape_proxy(&mut self) -> ShapeProxy

Source

pub fn explosion_def(&mut self) -> ExplosionDef

Source

pub fn body_def(&mut self) -> BodyDef

Source

pub fn shape_def(&mut self) -> ShapeDef

Source

pub fn parallel_joint_def(&mut self) -> ParallelJointDef

Source

pub fn distance_joint_def(&mut self) -> DistanceJointDef

Source

pub fn filter_joint_def(&mut self) -> FilterJointDef

Source

pub fn motor_joint_def(&mut self) -> MotorJointDef

Source

pub fn prismatic_joint_def(&mut self) -> PrismaticJointDef

Source

pub fn revolute_joint_def(&mut self) -> RevoluteJointDef

Source

pub fn spherical_joint_def(&mut self) -> SphericalJointDef

Source

pub fn weld_joint_def(&mut self) -> WeldJointDef

Source

pub fn wheel_joint_def(&mut self) -> WheelJointDef

Trait Implementations§

Source§

impl<'a> Clone for SnapReader<'a>

Source§

fn clone(&self) -> SnapReader<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for SnapReader<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SnapReader<'a>

§

impl<'a> RefUnwindSafe for SnapReader<'a>

§

impl<'a> Send for SnapReader<'a>

§

impl<'a> Sync for SnapReader<'a>

§

impl<'a> Unpin for SnapReader<'a>

§

impl<'a> UnsafeUnpin for SnapReader<'a>

§

impl<'a> UnwindSafe for SnapReader<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.