@@ -122,13 +122,23 @@ impl Sequence {
122122 }
123123
124124 /// Constructs a new `Sequence` from a prefixed hex string.
125+ ///
126+ /// # Errors
127+ ///
128+ /// If the input string is not a valid hex representation of a locktime or it does not include
129+ /// the `0x` prefix.
125130 #[ inline]
126131 pub fn from_hex ( s : & str ) -> Result < Self , PrefixedHexError > {
127132 let lock_time = parse:: hex_u32_prefixed ( s) ?;
128133 Ok ( Self :: from_consensus ( lock_time) )
129134 }
130135
131136 /// Constructs a new `Sequence` from an unprefixed hex string.
137+ ///
138+ /// # Errors
139+ ///
140+ /// If the input string is not a valid hex representation of a locktime or if it includes the
141+ /// `0x` prefix.
132142 #[ inline]
133143 pub fn from_unprefixed_hex ( s : & str ) -> Result < Self , UnprefixedHexError > {
134144 let lock_time = parse:: hex_u32_unprefixed ( s) ?;
@@ -152,6 +162,11 @@ impl Sequence {
152162 /// interval with floor division.
153163 ///
154164 /// Will return an error if the input cannot be encoded in 16 bits.
165+ ///
166+ /// # Errors
167+ ///
168+ /// Will return an error if `seconds` cannot be encoded in 16 bits. See
169+ /// [`NumberOf512Seconds::from_seconds_floor`].
155170 #[ inline]
156171 pub fn from_seconds_floor ( seconds : u32 ) -> Result < Self , TimeOverflowError > {
157172 let intervals = NumberOf512Seconds :: from_seconds_floor ( seconds) ?;
@@ -162,6 +177,11 @@ impl Sequence {
162177 /// interval with ceiling division.
163178 ///
164179 /// Will return an error if the input cannot be encoded in 16 bits.
180+ ///
181+ /// # Errors
182+ ///
183+ /// Will return an error if `seconds` cannot be encoded in 16 bits. See
184+ /// [`NumberOf512Seconds::from_seconds_ceil`].
165185 #[ inline]
166186 pub fn from_seconds_ceil ( seconds : u32 ) -> Result < Self , TimeOverflowError > {
167187 let intervals = NumberOf512Seconds :: from_seconds_ceil ( seconds) ?;
0 commit comments