Skip to content

Commit cfc8b78

Browse files
committed
Fix misc rust documentation
1 parent 10c5dac commit cfc8b78

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

rust/src/custombinaryview.rs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//! An interface for providing your own [BinaryView]s to Binary Ninja.
15+
//! An interface for providing your own [`BinaryView`]s to Binary Ninja.
1616
1717
use binaryninjacore_sys::*;
1818

@@ -33,12 +33,12 @@ use crate::Endianness;
3333
use crate::rc::*;
3434
use crate::string::*;
3535

36-
/// Registers a custom [BinaryViewType] with the core.
36+
/// Registers a custom [`BinaryViewType`] with the core.
3737
///
3838
/// The `constructor` is called immediately after successful registration of the type with
39-
/// the core. The [BinaryViewType] argument passed to `constructor` is the object that the
40-
/// [AsRef<BinaryViewType>]
41-
/// implementation of the [CustomBinaryViewType] must return.
39+
/// the core. The [`BinaryViewType`] argument passed to `constructor` is the object that the
40+
/// [`AsRef<BinaryViewType>`]
41+
/// implementation of the [`CustomBinaryViewType`] must return.
4242
pub fn register_view_type<S, T, F>(name: S, long_name: S, constructor: F) -> &'static T
4343
where
4444
S: BnStrCompatible,
@@ -364,8 +364,8 @@ pub unsafe trait CustomBinaryView: 'static + BinaryViewBase + Sync + Sized {
364364
fn init(&mut self, args: Self::Args) -> Result<()>;
365365
}
366366

367-
/// Represents a partially initialized custom [BinaryView] that should be returned to the core
368-
/// from the `create_custom_view` method of a [CustomBinaryViewType].
367+
/// Represents a partially initialized custom [`BinaryView`] that should be returned to the core
368+
/// from the `create_custom_view` method of a [`CustomBinaryViewType`].
369369
#[must_use]
370370
pub struct CustomView<'builder> {
371371
// this object can't actually be treated like a real
@@ -380,34 +380,33 @@ impl<'a, T: CustomBinaryViewType> CustomViewBuilder<'a, T> {
380380
/// Begins creating a custom BinaryView.
381381
///
382382
/// This function may only be called from the `create_custom_view` function of a
383-
/// [CustomBinaryViewType].
383+
/// [`CustomBinaryViewType`].
384384
///
385385
/// `parent` specifies the view that the core will treat as the parent view, that
386386
/// Segments created against the created view will be backed by `parent`. It will
387-
/// usually be (but is not required to be) the `data` argument of the `create_custom_view`
388-
/// callback.
387+
/// usually be (but is not required to be) the `data` argument of the
388+
/// [`CustomBinaryViewType::create_custom_view`] callback.
389389
///
390390
/// `constructor` will not be called until well after the value returned by this function
391-
/// has been returned by the [CustomBinaryViewType::create_custom_view] callback to the core,
391+
/// has been returned by the [`CustomBinaryViewType::create_custom_view`] callback to the core,
392392
/// and may not ever be called if the value returned by this function is dropped or leaked.
393393
///
394394
/// # Errors
395395
///
396-
/// This function will fail if the [FileMetadata] object associated with the *expected* parent
396+
/// This function will fail if the [`crate::filemetadata::FileMetadata`] object associated with the *expected* parent
397397
/// (i.e., the `data` argument passed to the `create_custom_view` function) already has an
398-
/// associated [BinaryView] of the same [CustomBinaryViewType]. Multiple [BinaryView] objects
399-
/// of the same [BinaryViewType] belonging to the same [FileMetadata] object is prohibited and
398+
/// associated [`BinaryView`] of the same [`CustomBinaryViewType`]. Multiple [`BinaryView`] objects
399+
/// of the same [`BinaryViewType`] belonging to the same [`crate::filemetadata::FileMetadata`] object is prohibited and
400400
/// can cause strange, delayed segmentation faults.
401401
///
402402
/// # Safety
403403
///
404404
/// `constructor` should avoid doing anything with the object it returns, especially anything
405-
/// that would cause the core to invoke any of the [BinaryViewBase] methods. The core isn't
405+
/// that would cause the core to invoke any of the [`BinaryViewBase`] methods. The core isn't
406406
/// going to consider the object fully initialized until after that callback has run.
407407
///
408-
/// The [BinaryView] argument passed to the constructor function is the object that is expected
409-
/// to be returned by the [AsRef<BinaryView>] implementation required by the [BinaryViewBase] trait.
410-
/// TODO FIXME welp this is broke going to need 2 init callbacks
408+
/// The [`BinaryView`] argument passed to the constructor function is the object that is expected
409+
/// to be returned by the [`AsRef<BinaryView>`] implementation required by the [`BinaryViewBase`] trait.
411410
pub fn create<V>(self, parent: &BinaryView, view_args: V::Args) -> Result<CustomView<'a>>
412411
where
413412
V: CustomBinaryView,

rust/src/hlil/function.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ impl HighLevelILFunction {
220220
}
221221

222222
/// This gets just the HLIL variables - you may be interested in the union
223-
/// of [crate::function::Function::parameter_variables] and
224-
/// [crate::mlil::function::MediumLevelILFunction::aliased_variables] as well for all the
223+
/// of [`Function::parameter_variables`] and
224+
/// [`crate::mlil::function::MediumLevelILFunction::aliased_variables`] as well for all the
225225
/// variables used in the function
226226
pub fn variables(&self) -> Array<Variable> {
227227
let mut count = 0;
@@ -231,8 +231,8 @@ impl HighLevelILFunction {
231231
}
232232

233233
/// This returns a list of Variables that are taken reference to and used
234-
/// elsewhere. You may also wish to consider [HighLevelILFunction::variables]
235-
/// and [crate::function::Function::parameter_variables]
234+
/// elsewhere. You may also wish to consider [`HighLevelILFunction::variables`]
235+
/// and [`Function::parameter_variables`]
236236
pub fn aliased_variables(&self) -> Array<Variable> {
237237
let mut count = 0;
238238
let variables = unsafe { BNGetHighLevelILAliasedVariables(self.handle, &mut count) };
@@ -241,8 +241,8 @@ impl HighLevelILFunction {
241241
}
242242

243243
/// This gets just the HLIL SSA variables - you may be interested in the union
244-
/// of [crate::function::Function::parameter_variables] and
245-
/// [crate::mlil::function::MediumLevelILFunction::aliased_variables] as well for all the
244+
/// of [`Function::parameter_variables`] and
245+
/// [`crate::mlil::function::MediumLevelILFunction::aliased_variables`] as well for all the
246246
/// variables used in the function
247247
pub fn ssa_variables(&self) -> Array<HighLevelILSSAVariable> {
248248
let mut count = 0;

0 commit comments

Comments
 (0)