Struct solana_sdk::sysvar::recent_blockhashes::RecentBlockhashes [−][src]
#[repr(C)]pub struct RecentBlockhashes(_);
Methods from Deref<Target = Vec<Entry, Global>>
Returns the number of elements the vector can hold without reallocating.
Examples
let vec: Vec<i32> = Vec::with_capacity(10); assert_eq!(vec.capacity(), 10);
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
Examples
use std::io::{self, Write}; let buffer = vec![1, 2, 3, 5, 8]; io::sink().write(buffer.as_slice()).unwrap();
Returns a raw pointer to the vector’s buffer.
The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid.
The caller must also ensure that the memory the pointer (non-transitively) points to
is never written to (except inside an UnsafeCell
) using this pointer or any pointer
derived from it. If you need to mutate the contents of the slice, use as_mut_ptr
.
Examples
let x = vec![1, 2, 4]; let x_ptr = x.as_ptr(); unsafe { for i in 0..x.len() { assert_eq!(*x_ptr.add(i), 1 << i); } }
🔬 This is a nightly-only experimental API. (allocator_api
)
allocator_api
)Returns a reference to the underlying allocator.
Returns the number of elements in the vector, also referred to as its ‘length’.
Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
Trait Implementations
Returns the “default value” for a type. Read more
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<RecentBlockhashes, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<RecentBlockhashes, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Creates a value from an iterator. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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 RefUnwindSafe for RecentBlockhashes
impl Send for RecentBlockhashes
impl Sync for RecentBlockhashes
impl Unpin for RecentBlockhashes
impl UnwindSafe for RecentBlockhashes
Blanket Implementations
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V