// Copyright (c) The Diem Core Contributors
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0
use Result;
/// There are two interfaces--the `LeftScreen` and `RightScreen`--that need to be implemented for
/// the bytecode viewer and these can be mix-and-matched for different implementations.
///
/// The `LeftScreen` is the text that is displayed in the left-hand screen, and is scrollable. The
/// scrolling in this window will output `BytecodeInfo` objects. These objects are then consumed by
/// the `RightScreen` `source_for_code_location` function, which outputs text containing a context
/// (`left`, `remainder`) around the source code location identified by the passed in
/// `BytecodeInfo`.
/// The `LeftScreen` trait is used to index the code.
/// The `RightScreen` trait takes the indices output by the left screen (cursor movements that have
/// been possibly translated in some way, e.g., to (fdef_index, code_offset) pairs) and
/// translates these indices into a `SourceContext` view of the text held by the implementor of the
/// `RightScreen` trait.