diff --git a/bitcoin/src/blockdata/script/borrowed.rs b/bitcoin/src/blockdata/script/borrowed.rs index 82b65be53..4e0d017fe 100644 --- a/bitcoin/src/blockdata/script/borrowed.rs +++ b/bitcoin/src/blockdata/script/borrowed.rs @@ -110,6 +110,36 @@ impl Script { #[inline] pub fn as_mut_bytes(&mut self) -> &mut [u8] { &mut self.0 } + /// Returns the length in bytes of the script. + #[inline] + pub fn len(&self) -> usize { self.0.len() } + + /// Returns whether the script is the empty script. + #[inline] + pub fn is_empty(&self) -> bool { self.0.is_empty() } + + /// Returns a copy of the script data. + #[inline] + pub fn to_bytes(&self) -> Vec { self.0.to_owned() } + + /// Converts a [`Box