Add r_get_location() for RFileLockEntry

This commit is contained in:
Matthias Beyer 2017-01-20 15:23:20 +01:00
parent a5f47d4b2f
commit f362cbdd6d

View file

@ -17,6 +17,11 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// //
use ruru::AnyObject;
trait Wrap {
fn wrap(self) -> AnyObject;
}
#[allow(unused_variables)] #[allow(unused_variables)]
pub mod storeid { pub mod storeid {
use std::path::PathBuf; use std::path::PathBuf;
@ -28,6 +33,13 @@ pub mod storeid {
wrappable_struct!(StoreId, StoreIdWrapper, STOREID_WRAPPER); wrappable_struct!(StoreId, StoreIdWrapper, STOREID_WRAPPER);
class!(RStoreId); class!(RStoreId);
use store::Wrap;
impl Wrap for StoreId {
fn wrap(self) -> AnyObject {
Class::from_existing("RStoreId").wrap_data(self, &*STOREID_WRAPPER)
}
}
methods!( methods!(
RStoreId, RStoreId,
itself, itself,
@ -167,6 +179,7 @@ pub mod store {
use ruby_utils::IntoToml; use ruby_utils::IntoToml;
use toml_utils::IntoRuby; use toml_utils::IntoRuby;
use store::Wrap;
pub struct FLECustomWrapper(Box<FLE<'static>>); pub struct FLECustomWrapper(Box<FLE<'static>>);
@ -187,6 +200,15 @@ pub mod store {
wrappable_struct!(FLECustomWrapper, FileLockEntryWrapper, FLE_WRAPPER); wrappable_struct!(FLECustomWrapper, FileLockEntryWrapper, FLE_WRAPPER);
class!(RFileLockEntry); class!(RFileLockEntry);
methods!(
RFileLockEntry,
itself,
fn r_get_location() -> AnyObject {
itself.get_data(&*FLE_WRAPPER).get_location().clone().wrap()
}
);
wrappable_struct!(EntryHeader, EntryHeaderWrapper, ENTRY_HEADER_WRAPPER); wrappable_struct!(EntryHeader, EntryHeaderWrapper, ENTRY_HEADER_WRAPPER);
class!(REntryHeader); class!(REntryHeader);
methods!( methods!(