Trait Script

Source
pub trait Script: Debug + Any {
Show 26 methods // Required methods fn default_output_script_type(&self) -> OutputScriptType; fn default_format_type(&self) -> FormatOptions; // Provided methods fn is_output_supported(&self, output: OutputScriptType) -> bool { ... } fn custom_output_extension<'a>(&'a self) -> &'a str { ... } fn extract_messages(&self) -> Result<Vec<Message>> { ... } fn import_messages<'a>( &'a self, _messages: Vec<Message>, _file: Box<dyn WriteSeek + 'a>, _filename: &str, _encoding: Encoding, _replacement: Option<&'a ReplacementTable>, ) -> Result<()> { ... } fn import_messages_filename( &self, messages: Vec<Message>, filename: &str, encoding: Encoding, replacement: Option<&ReplacementTable>, ) -> Result<()> { ... } fn custom_export(&self, _filename: &Path, _encoding: Encoding) -> Result<()> { ... } fn custom_import<'a>( &'a self, _custom_filename: &'a str, _file: Box<dyn WriteSeek + 'a>, _encoding: Encoding, _output_encoding: Encoding, ) -> Result<()> { ... } fn custom_import_filename( &self, custom_filename: &str, filename: &str, encoding: Encoding, output_encoding: Encoding, ) -> Result<()> { ... } fn is_archive(&self) -> bool { ... } fn iter_archive_filename<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<String>> + 'a>> { ... } fn iter_archive_offset<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<u64>> + 'a>> { ... } fn open_file<'a>( &'a self, _index: usize, ) -> Result<Box<dyn ArchiveContent + 'a>> { ... } fn open_file_by_name<'a>( &'a self, name: &str, ignore_case: bool, ) -> Result<Box<dyn ArchiveContent + 'a>> { ... } fn open_file_by_offset<'a>( &'a self, offset: u64, ) -> Result<Box<dyn ArchiveContent + 'a>> { ... } fn archive_output_ext<'a>(&'a self) -> Option<&'a str> { ... } fn is_image(&self) -> bool { ... } fn export_image(&self) -> Result<ImageData> { ... } fn import_image<'a>( &'a self, _data: ImageData, _file: Box<dyn WriteSeek + 'a>, ) -> Result<()> { ... } fn import_image_filename( &self, data: ImageData, filename: &str, ) -> Result<()> { ... } fn is_multi_image(&self) -> bool { ... } fn export_multi_image<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<ImageDataWithName>> + 'a>> { ... } fn import_multi_image<'a>( &'a self, _data: Vec<ImageDataWithName>, _file: Box<dyn WriteSeek + 'a>, ) -> Result<()> { ... } fn import_multi_image_filename( &self, data: Vec<ImageDataWithName>, filename: &str, ) -> Result<()> { ... } fn extra_info<'a>(&'a self) -> Option<Box<dyn AnyDebug + 'a>> { ... }
}
Expand description

A trait for script types.

Required Methods§

Source

fn default_output_script_type(&self) -> OutputScriptType

Returns the default output script type for this script.

Source

fn default_format_type(&self) -> FormatOptions

Returns the default format options for this script.

Provided Methods§

Source

fn is_output_supported(&self, output: OutputScriptType) -> bool

Checks if the given output script type is supported by this script.

Source

fn custom_output_extension<'a>(&'a self) -> &'a str

Returns the output extension for this script when exporting with custom output.

Source

fn extract_messages(&self) -> Result<Vec<Message>>

Extract messages from this script.

Source

fn import_messages<'a>( &'a self, _messages: Vec<Message>, _file: Box<dyn WriteSeek + 'a>, _filename: &str, _encoding: Encoding, _replacement: Option<&'a ReplacementTable>, ) -> Result<()>

Import messages into this script.

  • messages - The messages to import.
  • file - A writer with seek capabilities to write the patched scripts.
  • filename - The path of the file to write the patched scripts.
  • encoding - The encoding to use for the patched scripts.
  • replacement - An optional replacement table for message replacements.
Source

fn import_messages_filename( &self, messages: Vec<Message>, filename: &str, encoding: Encoding, replacement: Option<&ReplacementTable>, ) -> Result<()>

Import messages into this script.

  • messages - The messages to import.
  • filename - The path of the file to write the patched scripts.
  • encoding - The encoding to use for the patched scripts.
  • replacement - An optional replacement table for message replacements.
Source

fn custom_export(&self, _filename: &Path, _encoding: Encoding) -> Result<()>

Exports data from this script.

  • filename - The path of the file to write the exported data.
  • encoding - The encoding to use for the exported data.
Source

fn custom_import<'a>( &'a self, _custom_filename: &'a str, _file: Box<dyn WriteSeek + 'a>, _encoding: Encoding, _output_encoding: Encoding, ) -> Result<()>

Imports data into this script.

  • custom_filename - The path of the file to import.
  • file - A writer with seek capabilities to write the patched scripts.
  • encoding - The encoding of the patched scripts.
  • output_encoding - The encoding to use for the imported file.
Source

fn custom_import_filename( &self, custom_filename: &str, filename: &str, encoding: Encoding, output_encoding: Encoding, ) -> Result<()>

Imports data into this script.

  • custom_filename - The path of the file to import.
  • filename - The path of the file to write the patched scripts.
  • encoding - The encoding of the patched scripts.
  • output_encoding - The encoding to use for the imported file.
Source

fn is_archive(&self) -> bool

Returns true if this script is an archive.

Source

fn iter_archive_filename<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<String>> + 'a>>

Returns an iterator over archive filenames.

Source

fn iter_archive_offset<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<u64>> + 'a>>

Returns an iterator over archive offsets.

Source

fn open_file<'a>( &'a self, _index: usize, ) -> Result<Box<dyn ArchiveContent + 'a>>

Opens a file in the archive by its index.

Source

fn open_file_by_name<'a>( &'a self, name: &str, ignore_case: bool, ) -> Result<Box<dyn ArchiveContent + 'a>>

Opens a file in the archive by its name.

  • name - The name of the file to open.
  • ignore_case - If true, the name comparison will be case-insensitive.
Source

fn open_file_by_offset<'a>( &'a self, offset: u64, ) -> Result<Box<dyn ArchiveContent + 'a>>

Opens a file in the archive by its offset.

Source

fn archive_output_ext<'a>(&'a self) -> Option<&'a str>

Returns output extension for archive output folder.

Source

fn is_image(&self) -> bool

Available on crate feature image only.

Returns true if this script type is an image.

Source

fn export_image(&self) -> Result<ImageData>

Available on crate feature image only.

Exports the image data from this script.

Source

fn import_image<'a>( &'a self, _data: ImageData, _file: Box<dyn WriteSeek + 'a>, ) -> Result<()>

Available on crate feature image only.

Imports an image into this script.

  • data - The image data to import.
  • file - A writer with seek capabilities to write the patched scripts.
Source

fn import_image_filename(&self, data: ImageData, filename: &str) -> Result<()>

Available on crate feature image only.

Imports an image into this script.

  • data - The image data to import.
  • filename - The path of the file to write the patched scripts.
Source

fn is_multi_image(&self) -> bool

Available on crate feature image only.

Returns true if this script is contains multiple images.

Source

fn export_multi_image<'a>( &'a self, ) -> Result<Box<dyn Iterator<Item = Result<ImageDataWithName>> + 'a>>

Available on crate feature image only.

Exports multiple images from this script.

Source

fn import_multi_image<'a>( &'a self, _data: Vec<ImageDataWithName>, _file: Box<dyn WriteSeek + 'a>, ) -> Result<()>

Available on crate feature image only.

Imports multiple images into this script.

  • data - A vector of image data with names to import.
  • file - A writer with seek capabilities to write the patched scripts.
Source

fn import_multi_image_filename( &self, data: Vec<ImageDataWithName>, filename: &str, ) -> Result<()>

Available on crate feature image only.

Imports multiple images into this script.

  • data - A vector of image data with names to import.
  • filename - The path of the file to write the patched scripts.
Source

fn extra_info<'a>(&'a self) -> Option<Box<dyn AnyDebug + 'a>>

Returns the extra information for this script.

Implementors§

Source§

impl Script for Asb

Available on crate feature artemis only.
Source§

impl Script for AstScript

Available on crate feature artemis only.
Source§

impl Script for TxtScript

Available on crate feature artemis only.
Source§

impl Script for Dsc

Available on crate features bgi-arc and bgi only.
Source§

impl Script for BgiAudio

Available on crate features bgi-audio and bgi only.
Source§

impl Script for BGIBpScript

Available on crate feature bgi only.
Source§

impl Script for BGIBsiScript

Available on crate feature bgi only.
Source§

impl Script for BgiCBG

Available on crate features bgi-img and bgi only.
Source§

impl Script for BgiImage

Available on crate features bgi-img and bgi only.
Source§

impl Script for BGIScript

Available on crate feature bgi only.
Source§

impl Script for CstScript

Available on crate feature cat-system only.
Source§

impl Script for CstlScript

Available on crate feature cat-system only.
Source§

impl Script for Hg3Image

Available on crate features cat-system-img and cat-system only.
Source§

impl Script for Pcm

Available on crate features circus-audio and circus only.
Source§

impl Script for CrxImage

Available on crate features circus-img and circus only.
Source§

impl Script for CrxdImage

Available on crate features circus-img and circus only.
Source§

impl Script for CircusMesScript

Available on crate feature circus only.
Source§

impl Script for Dref

Available on crate feature emote-img only.
Source§

impl Script for PImg

Available on crate feature emote-img only.
Source§

impl Script for SrcXmlScript

Available on crate feature entis-gls only.
Source§

impl Script for EscudeBinList

Available on crate feature escude only.
Source§

impl Script for EscudeBinScript

Available on crate feature escude only.
Source§

impl Script for RldScript

Available on crate feature ex-hibit only.
Source§

impl Script for BinScript

Available on crate feature hexen-haus only.
Source§

impl Script for TlgImage

Available on crate features kirikiri-img and kirikiri only.
Source§

impl Script for KsScript

Available on crate feature kirikiri only.
Source§

impl Script for Mdf

Available on crate feature kirikiri only.
Source§

impl Script for ScnScript

Available on crate feature kirikiri only.
Source§

impl Script for SimpleCrypt

Available on crate feature kirikiri only.
Source§

impl Script for SoftpalScript

Available on crate feature softpal only.
Source§

impl Script for Ws2DisasmScript

Available on crate feature will-plus only.
Source§

impl Script for Ws2Script

Available on crate feature will-plus only.
Source§

impl Script for ItufuruScript

Available on crate features yaneurao-itufuru and yaneurao only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for ArtemisArc<T>

Available on crate features artemis-arc and artemis only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for msg_tool::scripts::bgi::archive::v1::BgiArchive<T>

Available on crate features bgi-arc and bgi only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for msg_tool::scripts::bgi::archive::v2::BgiArchive<T>

Available on crate features bgi-arc and bgi only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for CSIntArc<T>

Available on crate features cat-system-arc and cat-system only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for CrmArchive<T>

Available on crate features circus-arc and circus only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for DatArchive<T>

Available on crate features circus-arc and circus only.
Source§

impl<T: Read + Seek + Debug + 'static> Script for PckArchive<T>

Available on crate features circus-arc and circus only.
Source§

impl<T: Read + Seek + Debug + Any> Script for EscudeBinArchive<T>

Available on crate features escude-arc and escude only.
Source§

impl<T: Read + Seek + Debug + Any> Script for ItufuruArchive<T>

Available on crate features yaneurao-itufuru and yaneurao only.