mirror of
https://github.com/servo/servo.git
synced 2025-06-17 04:44:28 +00:00
68 lines
3.1 KiB
Rust
68 lines
3.1 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
use dom::bindings::utils::{Reflector, Reflectable};
|
|
|
|
#[deriving(Encodable)]
|
|
pub struct TestBinding {
|
|
reflector: Reflector,
|
|
}
|
|
|
|
impl TestBinding {
|
|
pub fn BooleanAttribute(&self) -> bool { false }
|
|
pub fn SetBooleanAttribute(&self, _: bool) {}
|
|
pub fn ByteAttribute(&self) -> i8 { 0 }
|
|
pub fn SetByteAttribute(&self, _: i8) {}
|
|
pub fn OctetAttribute(&self) -> u8 { 0 }
|
|
pub fn SetOctetAttribute(&self, _: u8) {}
|
|
pub fn ShortAttribute(&self) -> i16 { 0 }
|
|
pub fn SetShortAttribute(&self, _: i16) {}
|
|
pub fn UnsignedShortAttribute(&self) -> u16 { 0 }
|
|
pub fn SetUnsignedShortAttribute(&self, _: u16) {}
|
|
pub fn LongAttribute(&self) -> i32 { 0 }
|
|
pub fn SetLongAttribute(&self, _: i32) {}
|
|
pub fn UnsignedLongAttribute(&self) -> u32 { 0 }
|
|
pub fn SetUnsignedLongAttribute(&self, _: u32) {}
|
|
pub fn LongLongAttribute(&self) -> i64 { 0 }
|
|
pub fn SetLongLongAttribute(&self, _: i64) {}
|
|
pub fn UnsignedLongLongAttribute(&self) -> u64 { 0 }
|
|
pub fn SetUnsignedLongLongAttribute(&self, _: u64) {}
|
|
pub fn FloatAttribute(&self) -> f32 { 0. }
|
|
pub fn SetFloatAttribute(&self, _: f32) {}
|
|
pub fn DoubleAttribute(&self) -> f64 { 0. }
|
|
pub fn SetDoubleAttribute(&self, _: f64) {}
|
|
|
|
pub fn GetBooleanAttributeNullable(&self) -> Option<bool> { Some(false) }
|
|
pub fn SetBooleanAttributeNullable(&self, _: Option<bool>) {}
|
|
pub fn GetByteAttributeNullable(&self) -> Option<i8> { Some(0) }
|
|
pub fn SetByteAttributeNullable(&self, _: Option<i8>) {}
|
|
pub fn GetOctetAttributeNullable(&self) -> Option<u8> { Some(0) }
|
|
pub fn SetOctetAttributeNullable(&self, _: Option<u8>) {}
|
|
pub fn GetShortAttributeNullable(&self) -> Option<i16> { Some(0) }
|
|
pub fn SetShortAttributeNullable(&self, _: Option<i16>) {}
|
|
pub fn GetUnsignedShortAttributeNullable(&self) -> Option<u16> { Some(0) }
|
|
pub fn SetUnsignedShortAttributeNullable(&self, _: Option<u16>) {}
|
|
pub fn GetLongAttributeNullable(&self) -> Option<i32> { Some(0) }
|
|
pub fn SetLongAttributeNullable(&self, _: Option<i32>) {}
|
|
pub fn GetUnsignedLongAttributeNullable(&self) -> Option<u32> { Some(0) }
|
|
pub fn SetUnsignedLongAttributeNullable(&self, _: Option<u32>) {}
|
|
pub fn GetLongLongAttributeNullable(&self) -> Option<i64> { Some(0) }
|
|
pub fn SetLongLongAttributeNullable(&self, _: Option<i64>) {}
|
|
pub fn GetUnsignedLongLongAttributeNullable(&self) -> Option<u64> { Some(0) }
|
|
pub fn SetUnsignedLongLongAttributeNullable(&self, _: Option<u64>) {}
|
|
pub fn GetFloatAttributeNullable(&self) -> Option<f32> { Some(0.) }
|
|
pub fn SetFloatAttributeNullable(&self, _: Option<f32>) {}
|
|
pub fn GetDoubleAttributeNullable(&self) -> Option<f64> { Some(0.) }
|
|
pub fn SetDoubleAttributeNullable(&self, _: Option<f64>) {}
|
|
}
|
|
|
|
impl Reflectable for TestBinding {
|
|
fn reflector<'a>(&'a self) -> &'a Reflector {
|
|
&self.reflector
|
|
}
|
|
|
|
fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
|
|
&mut self.reflector
|
|
}
|
|
}
|