Struct PointPtr
#[repr(C, align(4))]pub struct PointPtr {
pub xheader: XHeader,
/* private fields */
}
Expand description
Byte repr of a Point
Fields§
§xheader: XHeader
Implementations§
§impl PointPtr
impl PointPtr
pub fn as_sized(&self) -> &PointFatPtr
pub fn as_mut_sized(&mut self) -> &mut PointFatPtr
pub unsafe fn from_bytes_unchecked(b: &[u8]) -> &PointPtr ⓘ
pub unsafe fn from_bytes_unchecked(b: &[u8]) -> &PointPtr ⓘ
§Safety
Must be aligned valid point bytes.
pub fn reroute(&self, route: XHeader) -> MutXHeaderPoint<&PointPtr> ⓘ
pub fn check(&self, check: CheckHash) -> Result<(), Error>
pub fn as_point_bytes(&self) -> &[u8] ⓘ
Methods from Deref<Target = PFieldsThinPtr>§
pub fn pf_header(&self) -> &PFieldsHeader
pub fn as_sized(&self) -> &PFieldsPtr ⓘ
pub fn internal_consitent_length(&self) -> Result<(), Error>
pub fn internal_consitent_length(&self) -> Result<(), Error>
Check the header length fields and return the point size. This is the length without the hash.
pub fn check_signature(&self) -> Result<(), Error>
pub fn pfields_bytes(&self) -> &[u8] ⓘ
pub fn pfields_bytes(&self) -> &[u8] ⓘ
include padding
Trait Implementations§
§impl MutXHeader for PointPtr
impl MutXHeader for PointPtr
fn mut_xheader(&mut self) -> &mut XHeader
§impl Point for PointPtr
impl Point for PointPtr
fn as_arc(&self) -> PointArc ⓘ
fn byte_segments(&self) -> ByteSegments<'_>
fn hash_ref(&self) -> &B64<[u8; 32]>
fn xheader_ref(&self) -> &XHeader
fn as_fields(&self) -> &dyn PFields
§fn recv(&self) -> Option<U64>
fn recv(&self) -> Option<U64>
recv is a special field.
It depends on the context. Reading directly from the database it should return the stamp at which it was inserted.
NOTE: Do not rely on this value being unique - in the db or otherwise.
fn as_box(&self) -> PointBox ⓘ
§impl Serialize for PointPtr
impl Serialize for PointPtr
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PointPtr
impl RefUnwindSafe for PointPtr
impl Send for PointPtr
impl Sync for PointPtr
impl Unpin for PointPtr
impl UnwindSafe for PointPtr
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> NewPoint for Twhere
T: Point + MutXHeader,
impl<T> NewPoint for Twhere
T: Point + MutXHeader,
fn update_xheader(&mut self, nethead: &dyn SetXHeader)
§impl<T> PFields for Twhere
T: PointExt,
impl<T> PFields for Twhere
T: PointExt,
fn data(&self) -> &[u8] ⓘ
fn tail(&self) -> Option<Tail<'_>>
§fn padding(&self) -> &[u8] ⓘ
fn padding(&self) -> &[u8] ⓘ
Points are padded with upto 7 \xFF bytes and are u64 aligned - this is accessible here for completeness sake.
§fn linkpoint_header(&self) -> Option<&LinkPointHeader>
fn linkpoint_header(&self) -> Option<&LinkPointHeader>
Return a LinkPFieldsHeader, works for both key and link points.
§fn pfields_segments(&self) -> ByteSegments<'_>
fn pfields_segments(&self) -> ByteSegments<'_>
A utility function to translate this format into bytes for hashing & io