Struct bitcoins::types::script::Script[][src]

pub struct Script(_);

A Script is marked Vec for use as an opaque Script in SighashArgs structs.

Script::null() and Script::default() return the empty byte vector with a 0 prefix, which represents numerical 0, boolean false, or null bytestring.

Implementations

impl Script[src]

pub fn new(v: Vec<u8>) -> Self[src]

Instantate a new wrapped vector

pub fn null() -> Self[src]

Construct an empty wrapped vector instance.

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

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Return a reference to the underlying bytes

pub fn set_items(&mut self, v: Vec<u8>)[src]

Set the underlying items vector.

pub fn push(&mut self, i: u8)[src]

Push an item to the item vector.

pub fn len(&self) -> usize[src]

Return the length of the item vector.

pub fn is_empty(&self) -> bool[src]

Return true if the length of the item vector is 0.

pub fn len_prefix(&self) -> u8[src]

Determine the byte-length of the vector length prefix

pub fn insert(&mut self, index: usize, i: u8)[src]

Insert an item at the specified index.

Trait Implementations

impl AsRef<[u8]> for Script[src]

impl BitcoinScript for Script[src]

impl ByteFormat for Script[src]

type Error = SerError

An associated error type

impl Clone for Script[src]

impl Debug for Script[src]

impl Default for Script[src]

impl<'de> Deserialize<'de> for Script[src]

impl Eq for Script[src]

impl Extend<u8> for Script[src]

impl From<&'_ [u8]> for Script[src]

impl From<&'_ Script> for ScriptPubkey[src]

impl From<&'_ Script> for ScriptSig[src]

impl From<&'_ Script> for WitnessStackItem[src]

impl From<&'_ ScriptPubkey> for Script[src]

impl From<&'_ ScriptSig> for Script[src]

impl From<&'_ WitnessStackItem> for Script[src]

impl From<Vec<u8, Global>> for Script[src]

impl Hash for Script[src]

impl Index<Range<usize>> for Script[src]

type Output = [u8]

The returned type after indexing.

impl Index<usize> for Script[src]

type Output = u8

The returned type after indexing.

impl IndexMut<usize> for Script[src]

impl IntoIterator for Script[src]

type Item = u8

The type of the elements being iterated over.

type IntoIter = IntoIter<u8>

Which kind of iterator are we turning this into?

impl Ord for Script[src]

impl PartialEq<Script> for Script[src]

impl PartialOrd<Script> for Script[src]

impl Serialize for Script[src]

impl StructuralEq for Script[src]

impl StructuralPartialEq for Script[src]

Auto Trait Implementations

impl RefUnwindSafe for Script

impl Send for Script

impl Sync for Script

impl Unpin for Script

impl UnwindSafe for Script

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<A, T> AsBits<T> for A where
    T: BitStore + BitMemory,
    A: AsRef<[T]>, 

impl<T> Base32Len for T where
    T: AsRef<[u8]>, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'f, T> CheckBase32<Vec<u5, Global>> for T where
    T: AsRef<[u8]>, 
[src]

type Err = Error

Error type if conversion fails

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToBase32 for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.