Struct Item

Source
#[repr(C)]
pub struct Item { /* private fields */ }
Expand description

This type is the base class responsible for libosmium’s custom memory management.

It stores an object’s dynamic size and its actual subclass as an enum.

Implementations§

Source§

impl Item

Source

pub fn as_bytes(&self) -> &[u8]

Get the item’s data as byte slice padded to aligned_size

Source

pub fn aligned_size(&self) -> usize

Get the item’s dynamic size aligned to ALIGN_BYTES

Source

pub fn byte_size(&self) -> u32

Get the item’s dynamic size

Source

pub fn item_type(&self) -> ItemType

Get the item’s type

Source

pub fn cast(&self) -> Option<ItemRef<'_>>

Convert an item’s reference into a reference of its actual subclass

Trait Implementations§

Source§

impl AsMut<Item> for Area

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsMut<Item> for Changeset

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for ChangesetDiscussion

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for Node

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsMut<Item> for NodeRefList

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for OSMObject

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for Relation

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsMut<Item> for RelationMemberList

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for TagList

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsMut<Item> for Way

Source§

fn as_mut(&mut self) -> &mut Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsRef<Item> for Area

Source§

fn as_ref(&self) -> &Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsRef<Item> for Changeset

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for ChangesetDiscussion

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for Node

Source§

fn as_ref(&self) -> &Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsRef<Item> for NodeRefList

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for OSMObject

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for Relation

Source§

fn as_ref(&self) -> &Item

Cast to an [$crate :: item :: Item] reference

Source§

impl AsRef<Item> for RelationMemberList

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for TagList

Source§

fn as_ref(&self) -> &Item

Cast to an [crate :: item :: Item] reference

Source§

impl AsRef<Item> for Way

Source§

fn as_ref(&self) -> &Item

Cast to an [$crate :: item :: Item] reference

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnwindSafe for Item

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

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.